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

1 line
1.7 KiB
JavaScript

Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons"),Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton=function(t){Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.initializeBase(this,[t]),this._onclick_option$delegate=Function.createDelegate(this,this._onclick_option),this._onchange$delegate=Function.createDelegate(this,this._onchange)},Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.prototype={initialize:function(){var t=this.get_element().id;Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.callBaseMethod(this,"initialize"),this._select=$get(t+"_select"),$addHandler(this._select,"change",this._onchange$delegate);for(var e=0;e<this._select.options.length;e++){var o=this._select.options[e];$addHandler(o,"click",this._onclick_option$delegate)}},dispose:function(){for(var t=0;t<this._select.options.length;t++){var e=this._select.options[t];$removeHandler(e,"click",this._onclick_option$delegate)}$removeHandler(this._select,"change",this._onchange$delegate),Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.callBaseMethod(this,"dispose")},isImage:function(){return!1},callMethod:function(t,e){return!0},_onclick_option:function(t){if(!this.isEnable())return!1;var e=t.target;return e.parentNode.value=e.value,Sys.Extended.UI.HtmlEditor._stopEvent(t),!!Sys.Extended.UI.HtmlEditor.isSafari&&(this.callMethod(e.parentNode,t),!0)},_onchange:function(t){if(!this.isEnable())return!1;var e=t.target;return Sys.Extended.UI.HtmlEditor._stopEvent(t),this.callMethod(e,t),!0}},Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.SelectButton",Sys.Extended.UI.HtmlEditor.ToolbarButtons.CommonButton);