NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/ant-design-vue/lib/_util/switchScrollingEffect.js

28 lines
870 B
JavaScript
Raw Normal View History

2023-09-14 14:47:11 +08:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _getScrollBarSize = require('./getScrollBarSize');
var _getScrollBarSize2 = _interopRequireDefault(_getScrollBarSize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports['default'] = function (close) {
var bodyIsOverflowing = document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
if (!bodyIsOverflowing) {
return;
}
if (close) {
document.body.style.position = '';
document.body.style.width = '';
return;
}
var scrollBarSize = (0, _getScrollBarSize2['default'])();
if (scrollBarSize) {
document.body.style.position = 'relative';
document.body.style.width = 'calc(100% - ' + scrollBarSize + 'px)';
}
};