From 89db8cfac8b64b9a17da145dd064c3c44f71479d Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 20 Aug 2021 16:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E4=B8=8Bsimple=5Fcolor=5Fchooser=E7=9A=84=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/colorchooser/colorchooser.js | 2 +- .../editor.colorpicker.hex.simple.js | 116 +++++++++--------- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index ff10a642a..6f28535a0 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -91,7 +91,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, { }, setValue: function (color) { - this.combo.setValue(color || ""); + this.combo.setValue((color || "").toLowerCase()); }, getValue: function () { diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js index c1eb023cc..dced6aa4a 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js @@ -55,66 +55,70 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { type: "bi.vertical", tgap: 10, items: [{ - type: "bi.vertical_adapt", - rgap: 5, - items: [{ - el: { - type: "bi.layout", - cls: "color-picker-editor-display bi-card bi-border", - height: 16, + el: { + type: "bi.vertical_adapt", + rgap: 5, + columnSize: [16, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH], + items: [{ + el: { + type: "bi.layout", + cls: "color-picker-editor-display bi-card bi-border", + height: 16, + width: 16, + ref: function (_ref) { + self.colorShow = _ref; + } + }, width: 16, + }, { + type: "bi.label", + text: "#", + width: 10 + }, { + type: "bi.small_text_editor", ref: function (_ref) { - self.colorShow = _ref; - } - }, - width: 16, - }, { - type: "bi.label", - text: "#", - width: 10 - }, { - type: "bi.small_text_editor", - ref: function (_ref) { - self.hexEditor = _ref; - }, - cls: "color-picker-editor-input", - validationChecker: this._hexChecker, - allowBlank: true, - errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"), - width: c.HEX_WIDTH, - height: 20, - listeners: [{ - eventName: "EVENT_CHANGE", - action: function () { - self._checkHexEditor(); - if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { - self.colorShow.element.css("background-color", self.getValue()); - self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + self.hexEditor = _ref; + }, + cls: "color-picker-editor-input", + validationChecker: this._hexChecker, + allowBlank: true, + errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"), + width: c.HEX_WIDTH, + height: 20, + listeners: [{ + eventName: "EVENT_CHANGE", + action: function () { + self._checkHexEditor(); + if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { + self.colorShow.element.css("background-color", self.getValue()); + self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + } } - } + }] + }, RGB[0], { + el: BI.extend(Ws[0], { + ref: function (_ref) { + self.R = _ref + } + }), + width: c.RGB_WIDTH + }, RGB[1], { + el: BI.extend(Ws[1], { + ref: function (_ref) { + self.G = _ref + } + }), + width: c.RGB_WIDTH + }, RGB[2], { + el: BI.extend(Ws[2], { + ref: function (_ref) { + self.B = _ref + } + }), + rgap: -5, + width: c.RGB_WIDTH }] - }, RGB[0], { - el: BI.extend(Ws[0], { - ref: function (_ref) { - self.R = _ref - } - }), - width: c.RGB_WIDTH - }, RGB[1], { - el: BI.extend(Ws[1], { - ref: function (_ref) { - self.G = _ref - } - }), - width: c.RGB_WIDTH - }, RGB[2], { - el: BI.extend(Ws[2], { - ref: function (_ref) { - self.B = _ref - } - }), - width: c.RGB_WIDTH - }] + } }] }