choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
28 lines (22 loc) • 715 B
JavaScript
import { global } from 'choerodon-ui/shared';
export default function isStickySupport() {
var STICKY_SUPPORT = global.STICKY_SUPPORT;
if (STICKY_SUPPORT !== undefined) {
return STICKY_SUPPORT;
}
if (typeof window !== 'undefined') {
var vendorList = ['', '-webkit-', '-ms-', '-moz-', '-o-'];
var stickyElement = document.createElement('div');
var support = vendorList.some(function (vendor) {
stickyElement.style.position = "".concat(vendor, "sticky");
if (stickyElement.style.position !== '') {
return true;
}
return false;
});
global.STICKY_SUPPORT = support;
return support;
}
return true;
}
//# sourceMappingURL=isStickySupport.js.map