Browse Source

node家族

es6
guy 3 years ago
parent
commit
1c096f3467
  1. 54
      src/base/single/button/node/icontexticonnode.js
  2. 34
      src/base/single/button/node/icontextnode.js
  3. 26
      src/base/single/button/node/texticonnode.js

54
src/base/single/button/node/icontexticonnode.js

@ -25,9 +25,23 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
@ -37,43 +51,15 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var blank = BI.createWidget({
type: "bi.layout",
width: o.height,
height: o.height
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.height,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
},
top: 0,
bottom: 0,
right: 0
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank)
}))));
};
},
doClick: function () {

34
src/base/single/button/node/icontextnode.js

@ -24,9 +24,23 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
@ -37,20 +51,8 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text)
}))));
}]
};
},
doClick: function () {

26
src/base/single/button/node/texticonnode.js

@ -23,9 +23,16 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: ["fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
@ -36,20 +43,15 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
}, {
type: "bi.icon_label",
width: o.height,
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon)
}))));
}]
};
},
doClick: function () {

Loading…
Cancel
Save