Browse Source

Bug fix for supporting CKEditor (HTMLAttribute) inside a reloaded form

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2162 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 12 năm trước cách đây
mục cha
commit
74fd829ea1
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      js/wizardhelper.js

+ 10 - 0
js/wizardhelper.js

@@ -206,6 +206,16 @@ function WizardHelper(sClass, sFormPrefix, sState)
 			{ json_obj: this.ToJSON(), operation: 'obj_creation_form', target_state: sTargetState, transaction_id: sTransactionId },
 			function(data)
 			{
+				// Delete any previous instances of CKEditor
+				$('#'+sFormId).find('.htmlEditor').each(function() {
+					var sId = $(this).attr('id');
+					var editorInst = CKEDITOR.instances[sId];
+				    if (editorInst)
+				    {
+				    	editorInst.destroy(true);
+				    }
+				});
+
 				$('#'+sFormId).html(data);
 				onDelayedReady();
 				$('#'+sFormId).unblock();