|
|
@ -3940,7 +3940,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); |
|
|
|
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); |
|
|
|
return BI.extend(conf, { |
|
|
|
return BI.extend(conf, { |
|
|
|
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-card", |
|
|
|
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger", |
|
|
|
height: 30 |
|
|
|
height: 30 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -3948,7 +3948,8 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, { |
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
BI.ColorChooserTrigger.superclass._init.apply(this, arguments); |
|
|
|
BI.ColorChooserTrigger.superclass._init.apply(this, arguments); |
|
|
|
this.colorContainer = BI.createWidget({ |
|
|
|
this.colorContainer = BI.createWidget({ |
|
|
|
type: "bi.layout" |
|
|
|
type: "bi.layout", |
|
|
|
|
|
|
|
cls: "bi-card" |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var down = BI.createWidget({ |
|
|
|
var down = BI.createWidget({ |
|
|
@ -4274,7 +4275,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
errorText: BI.i18nText("BI-Color_Picker_Error_Text"), |
|
|
|
errorText: BI.i18nText("BI-Color_Picker_Error_Text"), |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: 255, |
|
|
|
value: 255, |
|
|
|
width: 35, |
|
|
|
width: 32, |
|
|
|
height: 20 |
|
|
|
height: 20 |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.each(Ws, function (i, w) { |
|
|
|
BI.each(Ws, function (i, w) { |
|
|
@ -4290,7 +4291,8 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
this.B = Ws[2]; |
|
|
|
this.B = Ws[2]; |
|
|
|
|
|
|
|
|
|
|
|
this.none = BI.createWidget({ |
|
|
|
this.none = BI.createWidget({ |
|
|
|
type: "bi.checkbox" |
|
|
|
type: "bi.checkbox", |
|
|
|
|
|
|
|
title: BI.i18nText("BI-Basic_Auto") |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.none.on(BI.Checkbox.EVENT_CHANGE, function () { |
|
|
|
this.none.on(BI.Checkbox.EVENT_CHANGE, function () { |
|
|
|
if (this.isSelected()) { |
|
|
|
if (this.isSelected()) { |
|
|
@ -4305,6 +4307,23 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.transparent = BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.checkbox", |
|
|
|
|
|
|
|
title: BI.i18nText("BI-Transparent_Color") |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.transparent.on(BI.Checkbox.EVENT_CHANGE, function () { |
|
|
|
|
|
|
|
if (this.isSelected()) { |
|
|
|
|
|
|
|
self.lastColor = self.getValue(); |
|
|
|
|
|
|
|
self.setValue("transparent"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self.setValue(self.lastColor || "#000000"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { |
|
|
|
|
|
|
|
self.colorShow.element.css("background-color", self.getValue()); |
|
|
|
|
|
|
|
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.htape", |
|
|
|
type: "bi.htape", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
@ -4314,21 +4333,21 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: RGB[0], |
|
|
|
el: RGB[0], |
|
|
|
lgap: 10, |
|
|
|
lgap: 10, |
|
|
|
width: 20 |
|
|
|
width: 16 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: this.R, |
|
|
|
el: this.R, |
|
|
|
width: 32 |
|
|
|
width: 32 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: RGB[1], |
|
|
|
el: RGB[1], |
|
|
|
lgap: 10, |
|
|
|
lgap: 10, |
|
|
|
width: 20 |
|
|
|
width: 16 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: this.G, |
|
|
|
el: this.G, |
|
|
|
width: 32 |
|
|
|
width: 32 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: RGB[2], |
|
|
|
el: RGB[2], |
|
|
|
lgap: 10, |
|
|
|
lgap: 10, |
|
|
|
width: 20 |
|
|
|
width: 16 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: this.B, |
|
|
|
el: this.B, |
|
|
|
width: 32 |
|
|
|
width: 32 |
|
|
@ -4337,18 +4356,33 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.center_adapt", |
|
|
|
type: "bi.center_adapt", |
|
|
|
items: [this.none] |
|
|
|
items: [this.none] |
|
|
|
}, |
|
|
|
}, |
|
|
|
width: 20 |
|
|
|
width: 18 |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
|
|
|
items: [this.transparent] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: 18 |
|
|
|
}] |
|
|
|
}] |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (color) { |
|
|
|
setValue: function (color) { |
|
|
|
|
|
|
|
if (color === "transparent") { |
|
|
|
|
|
|
|
this.transparent.setSelected(true); |
|
|
|
|
|
|
|
this.none.setSelected(false); |
|
|
|
|
|
|
|
this.R.setValue(""); |
|
|
|
|
|
|
|
this.G.setValue(""); |
|
|
|
|
|
|
|
this.B.setValue(""); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
if (!color) { |
|
|
|
if (!color) { |
|
|
|
color = ""; |
|
|
|
color = ""; |
|
|
|
this.none.setSelected(true); |
|
|
|
this.none.setSelected(true); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.none.setSelected(false); |
|
|
|
this.none.setSelected(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.transparent.setSelected(false); |
|
|
|
this.colorShow.element.css("background-color", color); |
|
|
|
this.colorShow.element.css("background-color", 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.R.setValue(BI.isNull(json.r) ? "" : json.r); |
|
|
@ -4357,6 +4391,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
|
|
|
|
if (this.transparent.isSelected()) { |
|
|
|
|
|
|
|
return "transparent"; |
|
|
|
|
|
|
|
} |
|
|
|
return BI.DOM.rgb2hex(BI.DOM.json2rgb({ |
|
|
|
return BI.DOM.rgb2hex(BI.DOM.json2rgb({ |
|
|
|
r: this.R.getValue(), |
|
|
|
r: this.R.getValue(), |
|
|
|
g: this.G.getValue(), |
|
|
|
g: this.G.getValue(), |
|
|
|