Browse Source

feat: 补充

es6
windy 5 years ago
parent
commit
50e0826515
  1. 4
      src/base/single/button/buttons/button.js
  2. 13
      src/core/wrapper/layout/flex/flex.center.js
  3. 5
      src/core/wrapper/layout/flex/flex.horizontal.center.js
  4. 5
      src/core/wrapper/layout/flex/flex.vertical.center.js
  5. 8
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js
  6. 5
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js
  7. 5
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js

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

@ -66,10 +66,6 @@ BI.Button = BI.inherit(BI.BasicButton, {
element: this, element: this,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap, vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
items: [{ items: [{
type: "bi.horizontal", type: "bi.horizontal",
items: [this.icon, this.text] items: [this.icon, this.text]

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

@ -8,7 +8,9 @@
BI.FlexCenterLayout = BI.inherit(BI.Layout, { BI.FlexCenterLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this, arguments), { 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 () { render: function () {
@ -19,7 +21,14 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.FlexCenterLayout.superclass._addElement.apply(this, arguments); 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; return w;
}, },

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

@ -33,11 +33,6 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, {
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable, scrollable: o.scrollable,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items items: o.items
}; };
}, },

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

@ -33,12 +33,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable, scrollable: o.scrollable,
hgap: o.hgap,
vgap: o.vgap, vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items 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) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.FlexWrapperCenterLayout.superclass._addElement.apply(this, arguments); 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; return w;
}, },

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

@ -35,11 +35,6 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, {
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable, scrollable: o.scrollable,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items items: o.items
}; };
}, },

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

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

Loading…
Cancel
Save