From 2554e49fa0fcab75c8733b841747ace93afc2409 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 10 Jul 2019 14:14:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-47726=20fix:=20simple=5Fcolor=5Feditor?= =?UTF-8?q?=E4=B8=8Ecolor=5Feditor=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colorpicker/editor.colorpicker.simple.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js b/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js index 819a0b3ab..b94ab411d 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js @@ -50,6 +50,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, { }); BI.each(Ws, function (i, w) { w.on(BI.TextEditor.EVENT_CHANGE, function () { + self._checkEditors(); if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { self.colorShow.element.css("background-color", self.getValue()); self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE); @@ -90,6 +91,18 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, { }); }, + _checkEditors: function () { + if(BI.isEmptyString(this.R.getValue())) { + this.R.setValue(0); + } + if(BI.isEmptyString(this.G.getValue())) { + this.G.setValue(0); + } + if(BI.isEmptyString(this.B.getValue())) { + this.B.setValue(0); + } + }, + setValue: function (color) { this.colorShow.element.css({"background-color": color}); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); From c4c947fbbec8f6bf12466e5f2b9f77b68193b570 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 10 Jul 2019 15:59:44 +0800 Subject: [PATCH 2/2] update --- .../multilayerselecttree/multilayerselecttree.leveltree.js | 2 +- .../multilayersingletree/multilayersingletree.leveltree.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index 5f6e24f57..9309de5ae 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js @@ -37,7 +37,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, { if (!BI.isKey(node.id)) { node.id = BI.UUID(); } - node.keyword = keyword; + node.keyword = node.keyword || keyword; extend.pNode = pNode; if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index 9a06dccb0..0de4d5a54 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/src/widget/multilayersingletree/multilayersingletree.leveltree.js @@ -37,7 +37,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, { if (!BI.isKey(node.id)) { node.id = BI.UUID(); } - node.keyword = keyword; + node.keyword = node.keyword || keyword; extend.pNode = pNode; if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node";