Browse Source

Merge pull request #165026 in DEC/fineui from master to feature/x

* commit 'aa28dedf23a0d6211ecccbdbeedf462a3b0c1c1b':
  BI-113533 fix: bi.color_chooser destroyWhenHide 场景下二次创建popup状态的保持问题
research/test
superman 2 years ago
parent
commit
f19b8bdeec
  1. 9
      src/case/colorchooser/colorchooser.js

9
src/case/colorchooser/colorchooser.js

@ -39,7 +39,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
width: o.el.type ? o.width : o.width - 2, width: o.el.type ? o.width : o.width - 2,
height: o.el.type ? o.height : o.height - 2 height: o.el.type ? o.height : o.height - 2
}, o.el), }, o.el),
popup: { popup: () => ({
el: BI.extend({ el: BI.extend({
type: "bi.hex_color_chooser_popup", type: "bi.hex_color_chooser_popup",
recommendColorsGetter: o.recommendColorsGetter, recommendColorsGetter: o.recommendColorsGetter,
@ -64,13 +64,13 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
}, o.popup), }, o.popup),
value: o.value, value: o.value,
width: 300 width: 300
}, }),
value: o.value value: o.value
}); });
var fn = function () { var fn = function () {
var color = self.colorPicker.getValue(); var color = self.colorPicker.getValue();
self.trigger.setValue(color); self.setValue(color);
}; };
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
@ -98,7 +98,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
}, },
setValue: function (color) { setValue: function (color) {
this.combo.setValue((color || "").toLowerCase()); this.options.value = (color || "").toLowerCase();
this.combo.setValue(this.options.value);
}, },
getValue: function () { getValue: function () {

Loading…
Cancel
Save