Browse Source

CHART-21632 fix:与交互沟通,自动/透明按钮再次点击时不取消选中

es6
Tangjinxia 3 years ago
parent
commit
5e8abc7b6a
  1. 30
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  2. 30
      src/case/colorchooser/colorpicker/editor.colorpicker.js

30
src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

@ -72,20 +72,9 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
listeners: [{ listeners: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE, eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () { action: function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("transparent");
self.setValue("transparent"); (value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
if (self.lastColor === "transparent") {
self.lastColor = "";
}
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) ||
self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
} }
}], }],
ref: function (_ref) { ref: function (_ref) {
@ -101,16 +90,9 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
listeners: [{ listeners: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE, eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () { action: function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("");
self.setValue(""); (value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) || self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
} }
}], }],
ref: function (_ref) { ref: function (_ref) {

30
src/case/colorchooser/colorpicker/editor.colorpicker.js

@ -72,16 +72,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
title: BI.i18nText("BI-Basic_Auto") title: BI.i18nText("BI-Basic_Auto")
}); });
this.none.on(BI.IconButton.EVENT_CHANGE, function () { this.none.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("");
self.setValue(""); (value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) || self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}); });
this.transparent = BI.createWidget({ this.transparent = BI.createWidget({
@ -94,20 +87,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
title: BI.i18nText("BI-Transparent_Color") title: BI.i18nText("BI-Transparent_Color")
}); });
this.transparent.on(BI.IconButton.EVENT_CHANGE, function () { this.transparent.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("transparent");
self.setValue("transparent"); (value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
if (self.lastColor === "transparent") {
self.lastColor = "";
}
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) ||
self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}); });
BI.createWidget({ BI.createWidget({

Loading…
Cancel
Save