- gitlist.git
- src
- browser
- js
- menu-responsive.js
This file ( 890B ) 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 { nav, navButton } = options
if (nav === undefined) {
nav = $('#p3x-gitlist-navigation')
}
if (navButton === undefined) {
navButton = $('#p3x-gitlist-navigation-menu-button');
}
const debounce = require('lodash/debounce')
const debounceResize = debounce(() => {
if (navButton.is(':visible')) {
menuList.css({
'maxHeight': 'auto',
'overflowX': 'visible',
});
} else {
const allowedMaxHeight = window.innerHeight - nav.height() - 20;
menuList.css({
'maxHeight': allowedMaxHeight,
'overflowX': 'auto'
});
}
}, 250);
window.addEventListener('resize', debounceResize);
debounceResize();
return debounceResize;
}