equal
deleted
inserted
replaced
61 _this.editor_$.find(".Rk-Edit-ColorPicker").find("li").off('hover click'); |
61 _this.editor_$.find(".Rk-Edit-ColorPicker").find("li").off('hover click'); |
62 _this.editor_$.find(".Rk-CloseX").off('click'); |
62 _this.editor_$.find(".Rk-CloseX").off('click'); |
63 _this.editor_$.find(".Rk-Edit-Goto").off('click'); |
63 _this.editor_$.find(".Rk-Edit-Goto").off('click'); |
64 |
64 |
65 if(_this.options.show_node_editor_description_richtext) { |
65 if(_this.options.show_node_editor_description_richtext) { |
66 if(typeof _this.blurListener !== 'undefined') { |
66 if(typeof _this.editorListeners !== 'undefined') { |
67 _this.editorBlurListener.removeListener(); |
67 _this.editorListeners.forEach( function(listener) { |
|
68 listener.removeListener(); |
|
69 }); |
68 } |
70 } |
69 if(typeof editorInstance.editor !== 'undefined') { |
71 if(typeof editorInstance.editor !== 'undefined') { |
70 editorInstance.editor.destroy(); |
72 var _editor = editorInstance.editor; |
|
73 delete editorInstance.editor; |
|
74 _editor.destroy(); |
71 } |
75 } |
72 } |
76 } |
73 _this.renderer.removeRepresentation(_this); |
77 _this.renderer.removeRepresentation(_this); |
74 paper.view.draw(); |
78 paper.view.draw(); |
75 }; |
79 }; |
136 this.editor_$.find("input, textarea, select").on("change keyup paste", onFieldChange); |
140 this.editor_$.find("input, textarea, select").on("change keyup paste", onFieldChange); |
137 if( _this.options.show_node_editor_description && |
141 if( _this.options.show_node_editor_description && |
138 _this.options.show_node_editor_description_richtext && |
142 _this.options.show_node_editor_description_richtext && |
139 typeof editorInstance.editor !== 'undefined') |
143 typeof editorInstance.editor !== 'undefined') |
140 { |
144 { |
141 editorInstance.editor.on("change", onFieldChange); |
145 _this.editorListeners = []; |
142 _this.editorBlurListener = editorInstance.editor.on("blur", onFieldChange); |
146 _this.editorListeners.push(editorInstance.editor.on("change", onFieldChange)); |
|
147 _this.editorListeners.push(editorInstance.editor.on("blur", onFieldChange)); |
143 } |
148 } |
144 |
149 |
145 if(_this.options.allow_image_upload) { |
150 if(_this.options.allow_image_upload) { |
146 this.editor_$.find(".Rk-Edit-Image-File").change(function() { |
151 this.editor_$.find(".Rk-Edit-Image-File").change(function() { |
147 if (this.files.length) { |
152 if (this.files.length) { |