The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/ui/client/lib/menu.js

15 lines
433 B

import _ from 'underscore';
import { menu } from '../../../ui-utils';
window.addEventListener('resize', _.debounce((() => {
let lastState = window.matchMedia('(min-width: 780px)').matches ? 'mini' : 'large';
menu.close();
return () => {
const futureState = window.matchMedia('(min-width: 780px)').matches ? 'mini' : 'large';
if (lastState !== futureState) {
lastState = futureState;
menu.close();
}
};
})(), 100));