diff --git a/src/case/colorchooser/colorchooser.popup.js b/src/case/colorchooser/colorchooser.popup.js index 2931c80a0..7781980cd 100644 --- a/src/case/colorchooser/colorchooser.popup.js +++ b/src/case/colorchooser/colorchooser.popup.js @@ -10,13 +10,14 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { props: { baseCls: "bi-color-chooser-popup", width: 230, - height: 145 + height: 145, + simple: false // 简单模式, popup中没有自动和透明 }, render: function () { var self = this, o = this.options; this.colorEditor = BI.createWidget(o.editor, { - type: "bi.color_picker_editor", + type: o.simple ? "bi.simple_color_picker_editor" : "bi.color_picker_editor", value: o.value, cls: "bi-header-background bi-border-bottom", height: 30 @@ -31,7 +32,7 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { this.storeColors = BI.createWidget({ type: "bi.color_picker", cls: "bi-border-bottom bi-border-right", - items: [this._digestStoreColors(BI.string2Array(BI.Cache.getItem("colors") || ""))], + items: [this._digestStoreColors(this._getStoreColors())], width: 210, height: 24, value: o.value @@ -175,7 +176,7 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { _dealStoreColors: function () { var color = this.getValue(); - var colors = BI.string2Array(BI.Cache.getItem("colors") || ""); + var colors = this._getStoreColors(); var que = new BI.Queue(8); que.fromArray(colors); que.remove(color); @@ -200,6 +201,18 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { return items; }, + _getStoreColors: function() { + var self = this, o = this.options; + var colorsArray = BI.string2Array(BI.Cache.getItem("colors") || ""); + return BI.filter(colorsArray, function (idx, color) { + return o.simple ? self._isRGBColor(color) : true; + }); + }, + + _isRGBColor: function (color) { + return BI.isNotEmptyString(color) && color !== "transparent"; + }, + setStoreColors: function (colors) { if (BI.isArray(colors)) { this.storeColors.populate([this._digestStoreColors(colors)]); diff --git a/src/case/colorchooser/colorchooser.popup.simple.js b/src/case/colorchooser/colorchooser.popup.simple.js index 8f77dbd45..bae3a1455 100644 --- a/src/case/colorchooser/colorchooser.popup.simple.js +++ b/src/case/colorchooser/colorchooser.popup.simple.js @@ -20,9 +20,7 @@ BI.SimpleColorChooserPopup = BI.inherit(BI.Widget, { type: "bi.color_chooser_popup", value: o.value, element: this, - editor: { - type: "bi.simple_color_picker_editor" - } + simple: true // 是否有自动 }); this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE, function () { self.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE, arguments); diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 9d5f47dde..4f3eb9153 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -52,7 +52,7 @@ BI.SelectList = BI.inherit(BI.Widget, { callback.apply(self, arguments); if (op.times === 1) { self.toolbar.setVisible(items && items.length > 0); - self.toolbar.setEnable(!o.disabled && items && items.length > 0); + self.toolbar.setEnable(items && items.length > 0); } self._checkAllSelected(); }); @@ -161,7 +161,7 @@ BI.SelectList = BI.inherit(BI.Widget, { populate: function (items) { var o = this.options; this.toolbar.setVisible(!BI.isEmptyArray(items)); - this.toolbar.setEnable(!o.disabled && !BI.isEmptyArray(items)); + this.toolbar.setEnable(!BI.isEmptyArray(items)); this.list.populate.apply(this.list, arguments); this._checkAllSelected(); }, diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index 90a42a730..53e4466b6 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -127,7 +127,6 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { cls: "bi-list-item-active", height: 24, selected: this.isAllSelected(), - disabled: this.options.disabled, iconWrapperWidth: 36 }); },