diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index a76540c21..85ab78d06 100644 --- a/src/base/single/button/buttons/button.js +++ b/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] diff --git a/src/core/wrapper/layout/flex/flex.center.js b/src/core/wrapper/layout/flex/flex.center.js index f6073505e..add02edbb 100644 --- a/src/core/wrapper/layout/flex/flex.center.js +++ b/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; }, diff --git a/src/core/wrapper/layout/flex/flex.horizontal.center.js b/src/core/wrapper/layout/flex/flex.horizontal.center.js index 602e4b8cc..6639e46de 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.center.js +++ b/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 diff --git a/src/core/wrapper/layout/flex/flex.vertical.center.js b/src/core/wrapper/layout/flex/flex.vertical.center.js index fea81ef49..a87ad2da7 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.center.js +++ b/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 }; }, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js index 7ba06fe75..9be30ab8f 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js +++ b/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; }, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js index 9a4d271eb..0f54ab6cf 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js +++ b/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 diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js index c5a6a029b..b572b3088 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js +++ b/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 }; }, diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index 74d8792fa..49319ea9d 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/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 () { diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index f067f2ef0..9a06dccb0 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/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 () {