Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed possible cause for hang when deleting an optional parameter wit…
…h an

instance of ckeditor attached
  • Loading branch information
torinfo committed Jun 14, 2015
1 parent 1c50dc9 commit 52244e9
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions editor/js/toolbox.js
Expand Up @@ -397,9 +397,6 @@ var EDITOR = (function ($, parent) {
return;
}

// Need to remove row from the screen
var $row = $("#opt_" + name).remove();

// Find the property in the data store
var key = parent.tree.getSelectedNodeKeys();

Expand All @@ -410,10 +407,25 @@ var EDITOR = (function ($, parent) {

console.log(lo_data[key]["attributes"]);

// Enable the optional parameter button
$('#insert_opt_' + name)
.switchClass('disabled', 'enabled')
.prop('disabled', false);
/**
* TOR 20150614
*
* Previously the row in the table was deleted
* You cannot do that, because when the optional parameter contains a
* Wysiwyg editor, when you add another optional parameter or move to
* another page, the ckeditor instance is being destroyed without the
* textarea, and this causes the editor to hang!
*
* // Need to remove row from the screen
* var $row = $("#opt_" + name).remove();
*
* // Enable the optional parameter button
* $('#insert_opt_' + name)
* .switchClass('disabled', 'enabled')
* .prop('disabled', false);
*/

parent.tree.showNodeData(key);
},

insertOptionalProperty = function (key, name, defaultvalue)
Expand Down

0 comments on commit 52244e9

Please sign in to comment.