|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
// 1、支持flex的浏览器下使用flex布局
|
|
|
|
|
// 2、不支持flex的浏览器下使用inline布局
|
|
|
|
|
// 3、当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了。当横向出滚动条时使用table布局,不出滚动条时使用float布局
|
|
|
|
|
var _isSupportFlex, _isSupportGrid; |
|
|
|
|
var _isSupportFlex, _isSupportGrid, _isSupportSticky; |
|
|
|
|
var isSupportFlex = function () { |
|
|
|
|
if (_isSupportFlex == null) { |
|
|
|
|
_isSupportFlex = !!(BI.isSupportCss3 && BI.isSupportCss3("flex")); |
|
|
|
@ -18,8 +18,7 @@
|
|
|
|
|
} |
|
|
|
|
return _isSupportGrid; |
|
|
|
|
}; |
|
|
|
|
// 判断浏览器是否支持sticky 属性
|
|
|
|
|
var isSupportSticky = (function () { |
|
|
|
|
var innerSupportSticky = function () { |
|
|
|
|
var vendorList = ["", "-webkit-", "-ms-", "-moz-", "-o-"], |
|
|
|
|
vendorListLength = vendorList.length, |
|
|
|
|
stickyElement = document.createElement("div"); |
|
|
|
@ -30,7 +29,14 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
})(); |
|
|
|
|
}; |
|
|
|
|
// 判断浏览器是否支持sticky 属性
|
|
|
|
|
var isSupportSticky = function () { |
|
|
|
|
if (_isSupportSticky == null) { |
|
|
|
|
_isSupportSticky = innerSupportSticky(); |
|
|
|
|
} |
|
|
|
|
return _isSupportSticky; |
|
|
|
|
}; |
|
|
|
|
BI.Plugin.configWidget("bi.horizontal", function (ob) { |
|
|
|
|
var supportFlex = isSupportFlex(); |
|
|
|
|
// // 在横向自适应场景下我们需要使用table的自适应撑出滚动条的特性(flex处理不了这种情况)
|
|
|
|
|