Browse Source

Pull request #2103: 无JIRA任务 补充下simple_color_chooser的布局调整

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '89db8cfac8b64b9a17da145dd064c3c44f71479d':
  无JIRA任务 补充下simple_color_chooser的布局调整
es6
windy 3 years ago
parent
commit
c16f7dcad7
  1. 2
      src/case/colorchooser/colorchooser.js
  2. 116
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js

2
src/case/colorchooser/colorchooser.js

@ -91,7 +91,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
}, },
setValue: function (color) { setValue: function (color) {
this.combo.setValue(color || ""); this.combo.setValue((color || "").toLowerCase());
}, },
getValue: function () { getValue: function () {

116
src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js

@ -55,66 +55,70 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
type: "bi.vertical", type: "bi.vertical",
tgap: 10, tgap: 10,
items: [{ items: [{
type: "bi.vertical_adapt", el: {
rgap: 5, type: "bi.vertical_adapt",
items: [{ rgap: 5,
el: { columnSize: [16, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH],
type: "bi.layout", items: [{
cls: "color-picker-editor-display bi-card bi-border", el: {
height: 16, type: "bi.layout",
cls: "color-picker-editor-display bi-card bi-border",
height: 16,
width: 16,
ref: function (_ref) {
self.colorShow = _ref;
}
},
width: 16, width: 16,
}, {
type: "bi.label",
text: "#",
width: 10
}, {
type: "bi.small_text_editor",
ref: function (_ref) { ref: function (_ref) {
self.colorShow = _ref; self.hexEditor = _ref;
} },
}, cls: "color-picker-editor-input",
width: 16, validationChecker: this._hexChecker,
}, { allowBlank: true,
type: "bi.label", errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
text: "#", width: c.HEX_WIDTH,
width: 10 height: 20,
}, { listeners: [{
type: "bi.small_text_editor", eventName: "EVENT_CHANGE",
ref: function (_ref) { action: function () {
self.hexEditor = _ref; self._checkHexEditor();
}, if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
cls: "color-picker-editor-input", self.colorShow.element.css("background-color", self.getValue());
validationChecker: this._hexChecker, self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
allowBlank: true, }
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 20,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._checkHexEditor();
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} }
} }]
}, RGB[0], {
el: BI.extend(Ws[0], {
ref: function (_ref) {
self.R = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref
}
}),
rgap: -5,
width: c.RGB_WIDTH
}] }]
}, RGB[0], { }
el: BI.extend(Ws[0], {
ref: function (_ref) {
self.R = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref
}
}),
width: c.RGB_WIDTH
}]
}] }]
} }

Loading…
Cancel
Save