Browse Source

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

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit 'ea61930f4ffbcdcef8d347279eb831bd117fc002':
  BI-113533 fix: bi.color_chooser destroyWhenHide 场景下二次创建popup状态的保持问题
es6
Dailer-刘荣歆 2 years ago
parent
commit
aa28dedf23
  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