Browse Source

Merge pull request #1004 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'c4c947fbbec8f6bf12466e5f2b9f77b68193b570':
  update
  BI-47726 fix: simple_color_editor与color_editor同步
master
guy 5 years ago
parent
commit
6cf1e0ea2f
  1. 13
      src/case/colorchooser/colorpicker/editor.colorpicker.simple.js
  2. 2
      src/widget/multilayerselecttree/multilayerselecttree.leveltree.js
  3. 2
      src/widget/multilayersingletree/multilayersingletree.leveltree.js

13
src/case/colorchooser/colorpicker/editor.colorpicker.simple.js

@ -50,6 +50,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
}); });
BI.each(Ws, function (i, w) { BI.each(Ws, function (i, w) {
w.on(BI.TextEditor.EVENT_CHANGE, function () { w.on(BI.TextEditor.EVENT_CHANGE, function () {
self._checkEditors();
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { if (self.R.isValid() && self.G.isValid() && self.B.isValid()) {
self.colorShow.element.css("background-color", self.getValue()); self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE); 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) { setValue: function (color) {
this.colorShow.element.css({"background-color": color}); this.colorShow.element.css({"background-color": color});
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));

2
src/widget/multilayerselecttree/multilayerselecttree.leveltree.js

@ -37,7 +37,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, {
if (!BI.isKey(node.id)) { if (!BI.isKey(node.id)) {
node.id = BI.UUID(); node.id = BI.UUID();
} }
node.keyword = keyword; node.keyword = node.keyword || keyword;
extend.pNode = pNode; extend.pNode = pNode;
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) {
extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; extend.type = "bi.multilayer_select_tree_mid_plus_group_node";

2
src/widget/multilayersingletree/multilayersingletree.leveltree.js

@ -37,7 +37,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, {
if (!BI.isKey(node.id)) { if (!BI.isKey(node.id)) {
node.id = BI.UUID(); node.id = BI.UUID();
} }
node.keyword = keyword; node.keyword = node.keyword || keyword;
extend.pNode = pNode; extend.pNode = pNode;
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) {
extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; extend.type = "bi.multilayer_single_tree_mid_plus_group_node";

Loading…
Cancel
Save