Browse Source

Pull request #1877: 无JIRA任务 stretch能够根据是否有滚动条能够动态选择,而不需要主动选择,为table_adapt兼容作准备

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '9beb6aa2a02e32d10e6f8a909354b03533516ff3':
  stretch能够根据是否有滚动条能够动态选择,而不需要主动选择
  stretch能够根据是否有滚动条能够动态选择,而不需要主动选择
es6
guy 4 years ago
parent
commit
4addfed56e
  1. 3
      src/core/wrapper/layout/adapt/float.horizontal.js
  2. 7
      src/core/wrapper/layout/flex/flex.horizontal.js
  3. 7
      src/core/wrapper/layout/flex/flex.vertical.js
  4. 7
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  5. 7
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  6. 3
      src/core/wrapper/layout/layout.horizontal.js
  7. 2
      src/core/wrapper/layout/layout.inline.js

3
src/core/wrapper/layout/adapt/float.horizontal.js

@ -1,5 +1,6 @@
/** /**
* 浮动的水平居中布局 * 浮动的水平居中布局
*/ */
BI.FloatHorizontalLayout = BI.inherit(BI.Layout); BI.FloatHorizontalLayout = function () {
};
BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout); BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout);

7
src/core/wrapper/layout/flex/flex.horizontal.js

@ -40,12 +40,15 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
w.element.css({ w.element.css({
position: "relative" position: "relative"
}); });
if (o.columnSize[i] !== "auto") { if (o.columnSize[i] === "fill" || o.columnSize[i] === "") {
if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && (o.columnSize[i] === "fill" || o.columnSize[i] === ""))) { if (o.horizontalAlign !== BI.HorizontalAlign.Stretch) {
if (o.scrollable === true || o.scrollx === true) {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }
}
if (o.columnSize[i] > 0) { if (o.columnSize[i] > 0) {
w.element.addClass("f-s-n");
w.element.width(o.columnSize[i] === "" ? "" : (o.columnSize[i] <= 1 ? ((o.columnSize[i] * 100).toFixed(1) + "%") : (o.columnSize[i] / BI.pixRatio + BI.pixUnit))); w.element.width(o.columnSize[i] === "" ? "" : (o.columnSize[i] <= 1 ? ((o.columnSize[i] * 100).toFixed(1) + "%") : (o.columnSize[i] / BI.pixRatio + BI.pixUnit)));
} }
if (o.columnSize[i] === "fill") { if (o.columnSize[i] === "fill") {

7
src/core/wrapper/layout/flex/flex.vertical.js

@ -39,12 +39,15 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
w.element.css({ w.element.css({
position: "relative" position: "relative"
}); });
if (o.rowSize[i] !== "auto") { if (o.rowSize[i] === "fill" || o.rowSize[i] === "") {
if (!(o.verticalAlign === BI.VerticalAlign.Stretch && (o.rowSize[i] === "fill" || o.rowSize[i] === ""))) { if (o.verticalAlign !== BI.VerticalAlign.Stretch) {
if (o.scrollable === true || o.scrolly === true) {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }
}
if (o.rowSize[i] > 0) { if (o.rowSize[i] > 0) {
w.element.addClass("f-s-n");
w.element.height(o.rowSize[i] === "" ? "" : (o.rowSize[i] <= 1 ? ((o.rowSize[i] * 100).toFixed(1) + "%") : (o.rowSize[i] / BI.pixRatio + BI.pixUnit))); w.element.height(o.rowSize[i] === "" ? "" : (o.rowSize[i] <= 1 ? ((o.rowSize[i] * 100).toFixed(1) + "%") : (o.rowSize[i] / BI.pixRatio + BI.pixUnit)));
} }
if (o.rowSize[i] === "fill") { if (o.rowSize[i] === "fill") {

7
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -36,12 +36,15 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
w.element.css({ w.element.css({
position: "relative" position: "relative"
}); });
if (o.columnSize[i] !== "auto") { if (o.columnSize[i] === "fill" || o.columnSize[i] === "") {
if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && (o.columnSize[i] === "fill" || o.columnSize[i] === ""))) { if (o.horizontalAlign !== BI.HorizontalAlign.Stretch) {
if (o.scrollable === true || o.scrollx === true) {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }
}
if (o.columnSize[i] > 0) { if (o.columnSize[i] > 0) {
w.element.addClass("f-s-n");
w.element.width(o.columnSize[i] === "" ? "" : (o.columnSize[i] <= 1 ? ((o.columnSize[i] * 100).toFixed(1) + "%") : (o.columnSize[i] / BI.pixRatio + BI.pixUnit))); w.element.width(o.columnSize[i] === "" ? "" : (o.columnSize[i] <= 1 ? ((o.columnSize[i] * 100).toFixed(1) + "%") : (o.columnSize[i] / BI.pixRatio + BI.pixUnit)));
} }
if (o.columnSize[i] === "fill") { if (o.columnSize[i] === "fill") {

7
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js

@ -36,12 +36,15 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
w.element.css({ w.element.css({
position: "relative" position: "relative"
}); });
if (o.rowSize[i] !== "auto") { if (o.rowSize[i] === "fill" || o.rowSize[i] === "") {
if (!(o.verticalAlign === BI.VerticalAlign.Stretch && (o.rowSize[i] === "fill" && o.rowSize[i] === ""))) { if (o.verticalAlign !== BI.VerticalAlign.Stretch) {
if (o.scrollable === true || o.scrolly === true) {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }
}
if (o.rowSize[i] > 0) { if (o.rowSize[i] > 0) {
w.element.addClass("f-s-n");
w.element.height(o.rowSize[i] === "" ? "" : (o.rowSize[i] <= 1 ? ((o.rowSize[i] * 100).toFixed(1) + "%") : (o.rowSize[i] / BI.pixRatio + BI.pixUnit))); w.element.height(o.rowSize[i] === "" ? "" : (o.rowSize[i] <= 1 ? ((o.rowSize[i] * 100).toFixed(1) + "%") : (o.rowSize[i] / BI.pixRatio + BI.pixUnit)));
} }
if (o.rowSize[i] === "fill") { if (o.rowSize[i] === "fill") {

3
src/core/wrapper/layout/layout.horizontal.js

@ -3,5 +3,6 @@
* @class BI.HorizontalLayout * @class BI.HorizontalLayout
* @extends BI.Layout * @extends BI.Layout
*/ */
BI.HorizontalLayout = BI.inherit(BI.Layout); BI.HorizontalLayout = function () {
};
BI.shortcut("bi.horizontal", BI.HorizontalLayout); BI.shortcut("bi.horizontal", BI.HorizontalLayout);

2
src/core/wrapper/layout/layout.inline.js

@ -54,7 +54,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
if (o.columnSize[i] === "fill") { if (o.columnSize[i] === "fill") {
w.element.css("min-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); w.element.css("min-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")");
} }
if (o.horizontalAlign === BI.HorizontalAlign.Stretch) { if (o.horizontalAlign === BI.HorizontalAlign.Stretch || !(o.scrollable === true || o.scrollx === true)) {
w.element.css("max-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); w.element.css("max-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")");
} }
} }

Loading…
Cancel
Save