1 line
2.1 KiB
JavaScript
1 line
2.1 KiB
JavaScript
Type.registerNamespace("Sys.Extended.UI.HtmlEditor");Sys.Extended.UI.HtmlEditor.ModePanel=function(n){Sys.Extended.UI.HtmlEditor.ModePanel.initializeBase(this,[n]);this._activated=!1;this._isActivating=!1;this._editPanel=null;this._cachedContent=null;this._onbeforeunload$delegate=Function.createDelegate(this,this._onbeforeunload)};Sys.Extended.UI.HtmlEditor.ModePanel.prototype={set_editPanel:function(n){this._editPanel=n},get_content:function(){return this._activated?this._getContent():this._cachedContent!=null?this._cachedContent:""},set_content:function(n){if(this._cachedContent=n,this._activated||this._isActivating){if(this._isActivating){var t=this;return setTimeout(function(){t.set_content(n)},10),!1}this._setContent(n)}else this._activate(n);return!0},_activate:function(){this.get_element().style.display="";this._isActivating=!0},_activateFinished:function(){this._activated=!0;this._isActivating=!1;this._editPanel._setActive();this._editPanel.get_autofocus()&&this._focus()},_deactivate:function(){this.get_element().style.display="none";this._activated=!1;this._isActivating=!1},initialize:function(){Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this,"initialize");Sys.Extended.UI.HtmlEditor.isIE&&$addHandlers(window,{beforeunload:this._onbeforeunload$delegate})},dispose:function(){Sys.Extended.UI.HtmlEditor.isIE&&$common.removeHandlers(window,{beforeunload:this._onbeforeunload$delegate});this._activated&&(Sys.Extended.UI.HtmlEditor.isIE&&this._onbeforeunload(),this._deactivate());Sys.Extended.UI.HtmlEditor.ModePanel.callBaseMethod(this,"dispose")},_onbeforeunload:function(){this._activated&&(this._editPanel._contentPrepared||(this._editPanel._prepareContentForPostback(this.get_content()),this._editPanel._contentPrepared=!0))},_getContent:function(){return this._cachedContent!=null?this._cachedContent:""},_setContent:function(){},_focus:function(){this._focused()},_focused:function(n){this._editPanel._focused(n);this._editPanel.set_autofocus(!0)},_really_focused:function(){this._editPanel._really_focused();this._editPanel.set_autofocus(!0)}};Sys.Extended.UI.HtmlEditor.ModePanel.registerClass("Sys.Extended.UI.HtmlEditor.ModePanel",Sys.UI.Control); |