Browse Source

BI-113533 fix: bi.color_chooser destroyWhenHide 场景下二次创建popup状态的保持问题

es6
zsmj 2 years ago
parent
commit
e774b33222
  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