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. 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: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
if (this.isSelected()) {
self.lastColor = self.getValue();
self.setValue("transparent");
} 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);
}
var value = self.getValue();
self.setValue("transparent");
(value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}],
ref: function (_ref) {
@ -101,16 +90,9 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
listeners: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
if (this.isSelected()) {
self.lastColor = self.getValue();
self.setValue("");
} 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);
}
var value = self.getValue();
self.setValue("");
(value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}],
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")
});
this.none.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) {
self.lastColor = self.getValue();
self.setValue("");
} 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);
}
var value = self.getValue();
self.setValue("");
(value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
});
this.transparent = BI.createWidget({
@ -94,20 +87,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
title: BI.i18nText("BI-Transparent_Color")
});
this.transparent.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) {
self.lastColor = self.getValue();
self.setValue("transparent");
} 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);
}
var value = self.getValue();
self.setValue("transparent");
(value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
});
BI.createWidget({

Loading…
Cancel
Save