Browse Source

Merge pull request #981 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '6af640df7e6d91c110708d98cb14b09bbebdeb8b':
  update
  feat: 补充
  button可配icon宽高
  无JIRA任务 设置不选multilayertree的getValue问题
es6
guy 5 years ago
parent
commit
8132dce9c5
  1. 12
      src/base/single/button/buttons/button.js
  2. 13
      src/core/wrapper/layout/flex/flex.center.js
  3. 2
      src/core/wrapper/layout/flex/flex.horizontal.center.js
  4. 4
      src/core/wrapper/layout/flex/flex.vertical.center.js
  5. 8
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js
  6. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js
  7. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js
  8. 10
      src/widget/multilayerselecttree/multilayerselecttree.leveltree.js
  9. 10
      src/widget/multilayersingletree/multilayersingletree.leveltree.js

12
src/base/single/button/buttons/button.js

@ -48,9 +48,12 @@ BI.Button = BI.inherit(BI.BasicButton, {
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
type: "bi.icon",
type: "bi.icon_label",
cls: o.iconCls,
width: 18,
height: o.height - 2
height: o.height - 2,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
this.text = BI.createWidget({
type: "bi.label",
@ -60,14 +63,9 @@ BI.Button = BI.inherit(BI.BasicButton, {
});
BI.createWidget({
type: "bi.center_adapt",
cls: o.iconCls,
element: this,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
items: [{
type: "bi.horizontal",
items: [this.icon, this.text]

13
src/core/wrapper/layout/flex/flex.center.js

@ -8,7 +8,9 @@
BI.FlexCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-center-adapt-layout"
baseCls: "bi-flex-center-adapt-layout",
hgap: 0,
vgap: 0
});
},
render: function () {
@ -19,7 +21,14 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) {
var o = this.options;
var w = BI.FlexCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative", "flex-shrink": "0"});
w.element.css({
position: "relative",
"flex-shrink": "0",
"margin-left": (i === 0 ? o.hgap : 0) + "px",
"margin-right": o.hgap + "px",
"margin-top": o.vgap + "px",
"margin-bottom": o.vgap + "px"
});
return w;
},

2
src/core/wrapper/layout/flex/flex.horizontal.center.js

@ -34,8 +34,6 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, {
scrollable: o.scrollable,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items

4
src/core/wrapper/layout/flex/flex.vertical.center.js

@ -33,12 +33,10 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
hgap: o.hgap,
items: o.items
};
},

8
src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js

@ -21,7 +21,13 @@ BI.FlexWrapperCenterLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) {
var o = this.options;
var w = BI.FlexWrapperCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative"});
w.element.css({
position: "relative",
"margin-left": (i === 0 ? o.hgap : 0) + "px",
"margin-right": o.hgap + "px",
"margin-top": o.vgap + "px",
"margin-bottom": o.vgap + "px"
});
return w;
},

2
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js

@ -36,8 +36,6 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, {
scrollable: o.scrollable,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items

2
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js

@ -38,8 +38,6 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, {
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items
};
},

10
src/widget/multilayerselecttree/multilayerselecttree.leveltree.js

@ -111,9 +111,9 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, {
el: {
type: "bi.loader",
isDefaultInit: o.itemsCreator !== BI.emptyFn,
chooseType: o.chooseType,
el: {
type: "bi.button_tree",
chooseType: o.chooseType,
behaviors: o.behaviors,
layouts: [{
type: "bi.vertical"
@ -150,8 +150,12 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, {
},
setValue: function (v) {
this.storeValue = v;
this.tree.setValue(v);
// getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了
if(this.options.chooseType === BI.Selection.None) {
} else {
this.storeValue = v;
this.tree.setValue(v);
}
},
getValue: function () {

10
src/widget/multilayersingletree/multilayersingletree.leveltree.js

@ -110,9 +110,9 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, {
el: {
type: "bi.loader",
isDefaultInit: o.itemsCreator !== BI.emptyFn,
chooseType: o.chooseType,
el: {
type: "bi.button_tree",
chooseType: o.chooseType,
behaviors: o.behaviors,
layouts: [{
type: "bi.vertical"
@ -149,8 +149,12 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, {
},
setValue: function (v) {
this.storeValue = v;
this.tree.setValue(v);
// getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了
if(this.options.chooseType === BI.Selection.None) {
} else {
this.storeValue = v;
this.tree.setValue(v);
}
},
getValue: function () {

Loading…
Cancel
Save