Browse Source

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

Merge in VISUAL/fineui from ~CLAIRE.TANG/fineui:master to master

* commit 'e47ae5a72ac3553a8fc10dbf589307bda20fc7bc':
  CHART-21632 fix:与交互沟通,自动/透明按钮再次点击时不取消选中
es6
Claire.Tang 3 years ago
parent
commit
ca962ca3c5
  1. 26
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  2. 26
      src/case/colorchooser/colorpicker/editor.colorpicker.js

26
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");
} else { (value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
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("");
} else { (value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
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) {

26
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("");
} else { (value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
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");
} else { (value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
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