Browse Source

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

* commit '8d793e6572ca5191072a68fbc5482863afa37640':
  BI-42928 fix: 传百分比被计算成数值
es6
windy 5 years ago
parent
commit
580cc6a5c9
  1. 6
      src/core/wrapper/layout/adapt/adapt.table.js
  2. 6
      src/core/wrapper/layout/layout.horizontal.js

6
src/core/wrapper/layout/adapt/adapt.table.js

@ -50,7 +50,11 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i));
td.element.width(width);
}
td.element.css({"max-width": o.columnSize[i] + "px"});
// 对于表现为td的元素设置最大宽度,有几点需要注意
// 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现
// 2、不能给多个td设置最大宽度,这样只会平分宽度
// 3、多百分比宽度就算了
td.element.css({"max-width": o.columnSize[i] <= 1 ? width : width + "px"});
if (i === 0) {
td.element.addClass("first-element");
}

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

@ -56,7 +56,11 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i] + "px"});
// 对于表现为td的元素设置最大宽度,有几点需要注意
// 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现
// 2、不能给多个td设置最大宽度,这样只会平分宽度
// 3、多百分比宽度就算了
td.element.css({"max-width": o.columnSize[i] <= 1 ? width : width + "px"});
if (i === 0) {
td.element.addClass("first-element");
}

Loading…
Cancel
Save