Files
SIG/Scripts/AjaxControlToolkit/Release/HtmlEditor.ModePanel.js
2024-11-05 10:47:20 -07:00

1 line
2.1 KiB
JavaScript

Type.registerNamespace("Sys.Extended.UI.HtmlEditor"),Sys.Extended.UI.HtmlEditor.ModePanel=function(t){Sys.Extended.UI.HtmlEditor.ModePanel.initializeBase(this,[t]),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(t){this._editPanel=t},get_content:function(){return this._activated?this._getContent():null!=this._cachedContent?this._cachedContent:""},set_content:function(t){if(this._cachedContent=t,this._activated||this._isActivating){if(this._isActivating){var e=this;return setTimeout(function(){e.set_content(t)},10),!1}this._setContent(t)}else this._activate(t);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 null!=this._cachedContent?this._cachedContent:""},_setContent:function(t){},_focus:function(){this._focused()},_focused:function(t){this._editPanel._focused(t),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);