windy 7 years ago
parent
commit
170f6b756a
  1. 30
      dist/bundle.js
  2. 30
      dist/case.js
  3. 30
      dist/fineui.js
  4. 30
      src/case/colorchooser/colorpicker/editor.colorpicker.js

30
dist/bundle.js vendored

@ -76904,6 +76904,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.ColorPickerEditor.superclass._init.apply(this, arguments); BI.ColorPickerEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = {};
this.colorShow = BI.createWidget({ this.colorShow = BI.createWidget({
type: "bi.layout", type: "bi.layout",
cls: "color-picker-editor-display bi-card", cls: "color-picker-editor-display bi-card",
@ -76932,7 +76933,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
BI.each(Ws, function (i, w) { BI.each(Ws, function (i, w) {
w.on(BI.TextEditor.EVENT_CHANGE, function () { w.on(BI.TextEditor.EVENT_CHANGE, function () {
self._checkEditors(); self._checkEditors();
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue()); self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} }
@ -77042,6 +77043,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
if(BI.isEmptyString(this.B.getValue())) { if(BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
this.storeValue = {
r: this.R.getValue() || 0,
g: this.G.getValue() || 0,
b: this.B.getValue() || 0
};
}, },
_showPreColor: function (color) { _showPreColor: function (color) {
@ -77062,6 +77068,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.R.setValue(""); this.R.setValue("");
this.G.setValue(""); this.G.setValue("");
this.B.setValue(""); this.B.setValue("");
this.storeValue = {
r: "",
g: "",
b: ""
};
return; return;
} }
if (!color) { if (!color) {
@ -77073,9 +77084,14 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.transparent.setSelected(false); this.transparent.setSelected(false);
this._showPreColor(color); this._showPreColor(color);
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.storeValue = {
this.G.setValue(BI.isNull(json.g) ? "" : json.g); r: BI.isNull(json.r) ? "" : json.r,
this.B.setValue(BI.isNull(json.b) ? "" : json.b); g: BI.isNull(json.r) ? "" : json.g,
b: BI.isNull(json.r) ? "" : json.b
};
this.R.setValue(this.storeValue.r);
this.G.setValue(this.storeValue.g);
this.B.setValue(this.storeValue.b);
}, },
getValue: function () { getValue: function () {
@ -77083,9 +77099,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
return "transparent"; return "transparent";
} }
return BI.DOM.rgb2hex(BI.DOM.json2rgb({ return BI.DOM.rgb2hex(BI.DOM.json2rgb({
r: this.R.getValue(), r: this.storeValue.r,
g: this.G.getValue(), g: this.storeValue.g,
b: this.B.getValue() b: this.storeValue.b
})); }));
} }
}); });

30
dist/case.js vendored

@ -4431,6 +4431,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.ColorPickerEditor.superclass._init.apply(this, arguments); BI.ColorPickerEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = {};
this.colorShow = BI.createWidget({ this.colorShow = BI.createWidget({
type: "bi.layout", type: "bi.layout",
cls: "color-picker-editor-display bi-card", cls: "color-picker-editor-display bi-card",
@ -4459,7 +4460,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
BI.each(Ws, function (i, w) { BI.each(Ws, function (i, w) {
w.on(BI.TextEditor.EVENT_CHANGE, function () { w.on(BI.TextEditor.EVENT_CHANGE, function () {
self._checkEditors(); self._checkEditors();
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue()); self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} }
@ -4569,6 +4570,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
if(BI.isEmptyString(this.B.getValue())) { if(BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
this.storeValue = {
r: this.R.getValue() || 0,
g: this.G.getValue() || 0,
b: this.B.getValue() || 0
};
}, },
_showPreColor: function (color) { _showPreColor: function (color) {
@ -4589,6 +4595,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.R.setValue(""); this.R.setValue("");
this.G.setValue(""); this.G.setValue("");
this.B.setValue(""); this.B.setValue("");
this.storeValue = {
r: "",
g: "",
b: ""
};
return; return;
} }
if (!color) { if (!color) {
@ -4600,9 +4611,14 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.transparent.setSelected(false); this.transparent.setSelected(false);
this._showPreColor(color); this._showPreColor(color);
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.storeValue = {
this.G.setValue(BI.isNull(json.g) ? "" : json.g); r: BI.isNull(json.r) ? "" : json.r,
this.B.setValue(BI.isNull(json.b) ? "" : json.b); g: BI.isNull(json.r) ? "" : json.g,
b: BI.isNull(json.r) ? "" : json.b
};
this.R.setValue(this.storeValue.r);
this.G.setValue(this.storeValue.g);
this.B.setValue(this.storeValue.b);
}, },
getValue: function () { getValue: function () {
@ -4610,9 +4626,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
return "transparent"; return "transparent";
} }
return BI.DOM.rgb2hex(BI.DOM.json2rgb({ return BI.DOM.rgb2hex(BI.DOM.json2rgb({
r: this.R.getValue(), r: this.storeValue.r,
g: this.G.getValue(), g: this.storeValue.g,
b: this.B.getValue() b: this.storeValue.b
})); }));
} }
}); });

30
dist/fineui.js vendored

@ -77147,6 +77147,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.ColorPickerEditor.superclass._init.apply(this, arguments); BI.ColorPickerEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = {};
this.colorShow = BI.createWidget({ this.colorShow = BI.createWidget({
type: "bi.layout", type: "bi.layout",
cls: "color-picker-editor-display bi-card", cls: "color-picker-editor-display bi-card",
@ -77175,7 +77176,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
BI.each(Ws, function (i, w) { BI.each(Ws, function (i, w) {
w.on(BI.TextEditor.EVENT_CHANGE, function () { w.on(BI.TextEditor.EVENT_CHANGE, function () {
self._checkEditors(); self._checkEditors();
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue()); self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} }
@ -77285,6 +77286,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
if(BI.isEmptyString(this.B.getValue())) { if(BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
this.storeValue = {
r: this.R.getValue() || 0,
g: this.G.getValue() || 0,
b: this.B.getValue() || 0
};
}, },
_showPreColor: function (color) { _showPreColor: function (color) {
@ -77305,6 +77311,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.R.setValue(""); this.R.setValue("");
this.G.setValue(""); this.G.setValue("");
this.B.setValue(""); this.B.setValue("");
this.storeValue = {
r: "",
g: "",
b: ""
};
return; return;
} }
if (!color) { if (!color) {
@ -77316,9 +77327,14 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.transparent.setSelected(false); this.transparent.setSelected(false);
this._showPreColor(color); this._showPreColor(color);
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.storeValue = {
this.G.setValue(BI.isNull(json.g) ? "" : json.g); r: BI.isNull(json.r) ? "" : json.r,
this.B.setValue(BI.isNull(json.b) ? "" : json.b); g: BI.isNull(json.r) ? "" : json.g,
b: BI.isNull(json.r) ? "" : json.b
};
this.R.setValue(this.storeValue.r);
this.G.setValue(this.storeValue.g);
this.B.setValue(this.storeValue.b);
}, },
getValue: function () { getValue: function () {
@ -77326,9 +77342,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
return "transparent"; return "transparent";
} }
return BI.DOM.rgb2hex(BI.DOM.json2rgb({ return BI.DOM.rgb2hex(BI.DOM.json2rgb({
r: this.R.getValue(), r: this.storeValue.r,
g: this.G.getValue(), g: this.storeValue.g,
b: this.B.getValue() b: this.storeValue.b
})); }));
} }
}); });

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

@ -18,6 +18,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
BI.ColorPickerEditor.superclass._init.apply(this, arguments); BI.ColorPickerEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = {};
this.colorShow = BI.createWidget({ this.colorShow = BI.createWidget({
type: "bi.layout", type: "bi.layout",
cls: "color-picker-editor-display bi-card", cls: "color-picker-editor-display bi-card",
@ -46,7 +47,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
BI.each(Ws, function (i, w) { BI.each(Ws, function (i, w) {
w.on(BI.TextEditor.EVENT_CHANGE, function () { w.on(BI.TextEditor.EVENT_CHANGE, function () {
self._checkEditors(); self._checkEditors();
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue()); self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} }
@ -156,6 +157,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
if(BI.isEmptyString(this.B.getValue())) { if(BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
this.storeValue = {
r: this.R.getValue() || 0,
g: this.G.getValue() || 0,
b: this.B.getValue() || 0
};
}, },
_showPreColor: function (color) { _showPreColor: function (color) {
@ -176,6 +182,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.R.setValue(""); this.R.setValue("");
this.G.setValue(""); this.G.setValue("");
this.B.setValue(""); this.B.setValue("");
this.storeValue = {
r: "",
g: "",
b: ""
};
return; return;
} }
if (!color) { if (!color) {
@ -187,9 +198,14 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.transparent.setSelected(false); this.transparent.setSelected(false);
this._showPreColor(color); this._showPreColor(color);
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.storeValue = {
this.G.setValue(BI.isNull(json.g) ? "" : json.g); r: BI.isNull(json.r) ? "" : json.r,
this.B.setValue(BI.isNull(json.b) ? "" : json.b); g: BI.isNull(json.r) ? "" : json.g,
b: BI.isNull(json.r) ? "" : json.b
};
this.R.setValue(this.storeValue.r);
this.G.setValue(this.storeValue.g);
this.B.setValue(this.storeValue.b);
}, },
getValue: function () { getValue: function () {
@ -197,9 +213,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
return "transparent"; return "transparent";
} }
return BI.DOM.rgb2hex(BI.DOM.json2rgb({ return BI.DOM.rgb2hex(BI.DOM.json2rgb({
r: this.R.getValue(), r: this.storeValue.r,
g: this.G.getValue(), g: this.storeValue.g,
b: this.B.getValue() b: this.storeValue.b
})); }));
} }
}); });

Loading…
Cancel
Save