class CGraphEditLink extends CGraphDisplayLink { function CGraphEditLink() { if (owner.editMode == 'create') { makeEditable(); } } function makeEditable() { if (owner.editMode == 'create' || owner.editMode == 'completecosts') { graphic.num.text.type = 'input'; graphic.num.text.selectable = true; graphic.num.text.maxChars = 2; graphic.num.text.restrict = '0-9'; graphic.num.text.owner = this; graphic.num.text.onKillFocus = function () { this.owner.editLinkCost(); } } } function editLinkCost() { var nCost = Number(graphic.num.text.text); if (isNaN(nCost)) nCost = 0; graphic.num.text.text = nCost; link.attributes.cost = nCost; owner.trigger('onDataChange'); } }