Browse Source

chore: 优化代码

es6
guy 3 years ago
parent
commit
fabf8d7fc6
  1. 33
      src/case/colorchooser/colorchooser.popup.hex.js
  2. 2
      src/case/colorchooser/colorpicker/colorpicker.hex.js
  3. 2
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

33
src/case/colorchooser/colorchooser.popup.hex.js

@ -16,8 +16,7 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
var hasRecommendColors = BI.isNotNull(o.recommendColorsGetter());
return [{
el: {
type: 'bi.vertical',
type: "bi.vertical",
items: [{
el: {
type: "bi.vertical",
@ -60,12 +59,12 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
height: 22
}, {
el: hasRecommendColors ? {
type: 'bi.vertical',
type: "bi.vertical",
items: [{
type: 'bi.label',
text: BI.i18nText('BI-Basic_Recommend_Color'),
textAlign: 'left',
height: 24,
type: "bi.label",
text: BI.i18nText("BI-Basic_Recommend_Color"),
textAlign: "left",
height: 24
}, {
type: "bi.hex_color_picker",
cls: "bi-border-bottom bi-border-right",
@ -84,18 +83,18 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
self.recommendColors = _ref;
}
}]
} : { type: 'bi.layout' },
} : {type: "bi.layout"},
tgap: hasRecommendColors ? 10 : 0,
height: hasRecommendColors ? 47 : 0
}, {
el: {
type: 'bi.layout',
cls: 'bi-border-top',
type: "bi.layout",
cls: "bi-border-top"
},
vgap: 10,
height: 1
}, {
type: 'bi.absolute',
type: "bi.absolute",
items: [{
el: {
type: "bi.hex_color_picker",
@ -111,14 +110,14 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
}],
ref: function (_ref) {
self.colorPicker = _ref;
},
}
},
top: 0,
left: 0,
right: 0,
bottom: 1,
bottom: 1
}],
height: 80,
height: 80
}]
}
}, {
@ -186,11 +185,6 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
tgap: 10,
height: 24
}]
},
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
type: "bi.absolute",
items: [{
@ -212,7 +206,6 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
// 这里就实现的不好了,setValue里面有个editor,editor的setValue会检测错误然后出bubble提示
mounted: function () {
var self = this;
var o = this.options;
if (BI.isNotNull(o.value)) {
this.setValue(o.value);

2
src/case/colorchooser/colorpicker/colorpicker.hex.js

@ -110,8 +110,6 @@ BI.HexColorPicker = BI.inherit(BI.Widget, {
render: function () {
var self = this, o = this.options;
this.colors = BI.createWidget();
return {
type: "bi.button_group",
items: this._digest(o.items || this._items),

2
src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

@ -61,7 +61,7 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
tgap: 10,
items: [{
type: 'bi.vertical_adapt',
columnSize: [0.5, 'fill'],
columnSize: ["fill", 'fill'],
height: 24,
items: [{
type: "bi.color_picker_show_button",

Loading…
Cancel
Save