diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2013-11-21 16:16:22 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2013-11-26 11:42:51 +0100 |
commit | e0c2726e70dfed543f99560a111a8742630977a3 (patch) | |
tree | e2482a44c78af1ebc1c5de6750aac995836666d0 /framework/Web/Javascripts/source | |
parent | 388b15cd589298b32c1ade9cc4aa6a6a97411047 (diff) |
Ported THtmlArea
Diffstat (limited to 'framework/Web/Javascripts/source')
-rw-r--r-- | framework/Web/Javascripts/source/prado/controls/htmlarea.js | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea.js b/framework/Web/Javascripts/source/prado/controls/htmlarea.js index a425e697..819e853c 100644 --- a/framework/Web/Javascripts/source/prado/controls/htmlarea.js +++ b/framework/Web/Javascripts/source/prado/controls/htmlarea.js @@ -20,19 +20,13 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, { this.options = options; - var obj = this; - this.ajaxresponder = { - onComplete : function(request) - { - if(request && (request instanceof Prado.AjaxRequest)) - obj.checkInstance(); - } - }; this.registerAjaxHook(); this.registerInstance(); }, + + registerInstance: function() { if (typeof tinyMCE_GZ == 'undefined') @@ -74,7 +68,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, Prado.WebUI.THtmlArea.tinyMCELoadState = 255; var wrapper; while(Prado.WebUI.THtmlArea.pendingRegistrations.length>0) - if (wrapper = Prado.Registry.get(Prado.WebUI.THtmlArea.pendingRegistrations.pop())) + if (wrapper = Prado.Registry[Prado.WebUI.THtmlArea.pendingRegistrations.pop()]) wrapper.initInstance(); }, @@ -103,17 +97,19 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, registerAjaxHook: function() { - if (typeof(Ajax)!="undefined") - if (typeof(Ajax.Responders)!="undefined") - Ajax.Responders.register(this.ajaxresponder); + jQuery(document).on('ajaxComplete', this.ajaxresponder.bind(this)); }, deRegisterAjaxHook: function() { - if (typeof(Ajax)!="undefined") - if (typeof(Ajax.Responders)!="undefined") - Ajax.Responders.unregister(this.ajaxresponder); + jQuery(document).off('ajaxComplete', this.ajaxresponder.bind(this)); + }, + + ajaxresponder: function(request) + { + if(request && (request instanceof Prado.AjaxRequest)) + obj.checkInstance(); }, onDone: function() @@ -126,9 +122,9 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, tinyMCE.execCommand('mceFocus', false, this.ID); // when removed, tinyMCE restores its content to the textarea. If the textarea content has been // updated in this same callback, it will be overwritten with the old content. Workaround this. - var curtext = $(this.ID).value; + var curtext = $('#'+this.ID).get(0).value; tinyMCE.execCommand('mceRemoveControl', false, this.ID); - $(this.ID).value = curtext; + $('#'+this.ID).get(0).value = curtext; } catch (e) { @@ -143,7 +139,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, } }); -Object.extend(Prado.WebUI.THtmlArea, +jQuery.extend(Prado.WebUI.THtmlArea, { pendingRegistrations : [], tinyMCELoadState : 0 |