Commit e02e25a65434309aa1821397a64ef019c1c21be4

Authored by Elena.Budnik
1 parent 1166858d

check if win is open for warning

Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
js/app/models/InteractiveNode.js
... ... @@ -123,7 +123,7 @@ Ext.define('amdaModel.InteractiveNode', {
123 123 var desktop = myDesktopApp.getDesktop();
124 124 var win = desktop.getWindow(module.id);
125 125  
126   - if (win) {
  126 +
127 127 // If the node to edit is not already linked to this module
128 128 if (module.getLinkedNode() != me) {
129 129 // set relative node into parameter Module
... ... @@ -141,14 +141,14 @@ Ext.define('amdaModel.InteractiveNode', {
141 141 module.createLinkedNode();
142 142 module.createObject({name : me.get('text')});
143 143 }
144   - else {
145   - // myDesktopApp.warningMsg('This object is already being edited');
  144 + else if (win) {
  145 + myDesktopApp.warningMsg('This object is already being edited');
146 146 // return;
147 147 }
148 148 //Sol1: msg alert: "warning this node is already edited! If you want to get the original, please press the 'reset' button"->'OK'
149 149 //Sol2: msg with user choice: "warning this node is already edited! Would you confirm this action and lost your modification?"->'Confirm','Cancel'
150 150 }
151   - }
  151 +
152 152 // Opening parameter window
153 153 module.createWindow(onReady);
154 154 });
... ...