diff --git a/bi/case.js b/bi/case.js index 7e611e4541..8322524baf 100644 --- a/bi/case.js +++ b/bi/case.js @@ -9561,21 +9561,14 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { _init: function () { BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); var self = this, o = this.options; - var operators = []; - BI.each(o.buttons, function (i, btn) { - operators.push(BI.createWidget(BI.extend(btn, { - editor: o.editor - }))); - }); - this.element.on("mousedown", function () { - BI.each(operators, function (i, op) { - op.start(); - }); - }); BI.createWidget({ type: "bi.left", element: this, - items: operators, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), hgap: 3, vgap: 3 }) @@ -10288,10 +10281,6 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { }); }, - start: function () { - this.colorchooser.hideView(); - }, - deactivate: function () { } }); @@ -10331,10 +10320,6 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { }, - start: function () { - this.colorchooser.hideView(); - }, - deactivate: function () { this.colorchooser.setValue(""); } @@ -10412,10 +10397,6 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { this.hideView(); this.setValue([]); }) - }, - - start: function () { - this.combo.hideView(); } }); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** diff --git a/dist/bundle.js b/dist/bundle.js index 0e6c5517d6..d946e6a629 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -70981,21 +70981,14 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { _init: function () { BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); var self = this, o = this.options; - var operators = []; - BI.each(o.buttons, function (i, btn) { - operators.push(BI.createWidget(BI.extend(btn, { - editor: o.editor - }))); - }); - this.element.on("mousedown", function () { - BI.each(operators, function (i, op) { - op.start(); - }); - }); BI.createWidget({ type: "bi.left", element: this, - items: operators, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), hgap: 3, vgap: 3 }) @@ -71708,10 +71701,6 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { }); }, - start: function () { - this.colorchooser.hideView(); - }, - deactivate: function () { } }); @@ -71751,10 +71740,6 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { }, - start: function () { - this.colorchooser.hideView(); - }, - deactivate: function () { this.colorchooser.setValue(""); } @@ -71832,10 +71817,6 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { this.hideView(); this.setValue([]); }) - }, - - start: function () { - this.combo.hideView(); } }); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** diff --git a/dist/bundle.min.js b/dist/bundle.min.js index aa4b54c632..4e32d9992b 100644 --- a/dist/bundle.min.js +++ b/dist/bundle.min.js @@ -32,17 +32,17 @@ BI.ComplexCanvas.superclass._init.apply(this,arguments);var a=this.options;this. baseCls:"bi-color-picker",items:null})},_items:[[{value:"#ffffff"},{value:"#f2f2f2"},{value:"#e5e5e5"},{value:"#d9d9d9"},{value:"#cccccc"},{value:"#bfbfbf"},{value:"#b2b2b2"},{value:"#a6a6a6"},{value:"#999999"},{value:"#8c8c8c"},{value:"#808080"},{value:"#737373"},{value:"#666666"},{value:"#4d4d4d"},{value:"#333333"},{value:"#000000"}],[{value:"#d8b5a6"},{value:"#ff9e9a"},{value:"#ffc17d"},{value:"#f5e56b"},{value:"#d8e698"},{value:"#e0ebaf"},{value:"#c3d825"},{value:"#bce2e8"},{value:"#85d3cd"},{value:"#bce2e8"},{value:"#a0d8ef"},{value:"#89c3eb"},{value:"#bbc8e6"},{value:"#bbbcde"},{value:"#d6b4cc"},{value:"#fbc0d3"}],[{value:"#bb9581"},{value:"#f37d79"},{value:"#fba74f"},{value:"#ffdb4f"},{value:"#c7dc68"},{value:"#b0ca71"},{value:"#99ab4e"},{value:"#84b9cb"},{value:"#00a3af"},{value:"#2ca9e1"},{value:"#0095d9"},{value:"#4c6cb3"},{value:"#8491c3"},{value:"#a59aca"},{value:"#cc7eb1"},{value:"#e89bb4"}],[{value:"#9d775f"},{value:"#dd4b4b"},{value:"#ef8b07"},{value:"#fcc800"},{value:"#aacf53"},{value:"#82ae46"},{value:"#69821b"},{value:"#59b9c6"},{value:"#2a83a2"},{value:"#007bbb"},{value:"#19448e"},{value:"#274a78"},{value:"#4a488e"},{value:"#7058a3"},{value:"#884898"},{value:"#d47596"}]],_init:function(){BI.ColorPicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this.colors=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(b.items||this._items,{type:"bi.color_picker_button",once:!1}),layouts:[{type:"bi.grid"}]}),this.colors.on(BI.ButtonGroup.EVENT_CHANGE,function(){a.fireEvent(BI.ColorPicker.EVENT_CHANGE,arguments)})},populate:function(a){var b=[].slice.call(arguments);b[0]=BI.createItems(a,{type:"bi.color_picker_button",once:!1}),this.colors.populate.apply(this.colors,b)},setValue:function(a){this.colors.setValue(a)},getValue:function(){return this.colors.getValue()}}),BI.ColorPicker.EVENT_CHANGE="ColorPicker.EVENT_CHANGE",BI.shortcut("bi.color_picker",BI.ColorPicker),BI.ColorPickerEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",width:200,height:20})},_init:function(){BI.ColorPickerEditor.superclass._init.apply(this,arguments);var a=this;this.options;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card",height:20});var b=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:10,height:20})),c=function(a){return BI.isNumeric(a)&&(0|a)>=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:32,height:20});BI.each(d,function(b,c){c.on(BI.TextEditor.EVENT_CHANGE,function(){a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],this.none=BI.createWidget({type:"bi.checkbox",title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.Checkbox.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("")):a.setValue(a.lastColor||"#000000"),a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.checkbox",title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.Checkbox.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("transparent")):a.setValue(a.lastColor||"#000000"),a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,width:"fill"},{el:b[0],lgap:10,width:16},{el:this.R,width:32},{el:b[1],lgap:10,width:16},{el:this.G,width:32},{el:b[2],lgap:10,width:16},{el:this.B,width:32},{el:{type:"bi.center_adapt",items:[this.none]},width:18},{el:{type:"bi.center_adapt",items:[this.transparent]},width:18}]})},setValue:function(a){if("transparent"===a)return this.transparent.setSelected(!0),this.none.setSelected(!1),this.R.setValue(""),this.G.setValue(""),void this.B.setValue("");a?this.none.setSelected(!1):(a="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this.colorShow.element.css("background-color",a);var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.R.setValue(BI.isNull(b.r)?"":b.r),this.G.setValue(BI.isNull(b.g)?"":b.g),this.B.setValue(BI.isNull(b.b)?"":b.b)},getValue:function(){return this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.ColorPickerEditor.EVENT_CHANGE="ColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.Farbtastic=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-farbtastic",width:195,height:195})},_init:function(){BI.Farbtastic.superclass._init.apply(this,arguments)},mounted:function(){var a=this;this.farbtastic=$.farbtastic(this.element,function(b){a.fireEvent(BI.Farbtastic.EVENT_CHANGE,a.getValue(),a)})},setValue:function(a){this.farbtastic.setColor(a)},getValue:function(){return this.farbtastic.color}}),BI.Farbtastic.EVENT_CHANGE="Farbtastic.EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),jQuery.fn.farbtastic=function(a){return $.farbtastic(this,a),this},jQuery.farbtastic=function(a,b){var a=$(a).get(0);return a.farbtastic||(a.farbtastic=new jQuery._farbtastic(a,b))},jQuery._farbtastic=function(a,b){var c=this;$(a).html('