- gitlist.git
- src
- browser
- js
- menu-responsive.js
This file ( 999B ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
module.exports = (options) => {
const { menuList } = options;
let { shift, nav, navButton } = options
if (nav === undefined) {
nav = $('#p3x-gitlist-navigation')
}
if (navButton === undefined) {
navButton = $('#p3x-gitlist-navigation-menu-button');
}
if (shift === undefined) {
shift = 0;
}
const debounce = require('lodash/debounce')
const debounceResize = debounce(() => {
if (navButton.is(':visible') && options.alwaysCalculate !== true) {
menuList.css({
'maxHeight': 'auto',
'overflowX': 'visible',
});
} else {
const allowedMaxHeight = window.innerHeight - nav.height() - 20 - shift;
menuList.css({
'maxHeight': allowedMaxHeight,
'overflowX': 'auto'
});
}
}, 250);
window.addEventListener('resize', debounceResize);
debounceResize();
return debounceResize;
}