gitlab-org--gitlab-foss/app/assets/javascripts/breakpoints.js

23 lines
456 B
JavaScript
Raw Normal View History

export const breakpoints = {
lg: 1200,
md: 992,
sm: 768,
xs: 0,
};
const BreakpointInstance = {
windowWidth: () => window.innerWidth,
getBreakpointSize() {
const windowWidth = this.windowWidth();
2016-07-24 16:45:11 -04:00
const breakpoint = Object.keys(breakpoints).find(key => windowWidth > breakpoints[key]);
2016-07-24 16:45:11 -04:00
return breakpoint;
},
isDesktop() {
return ['lg', 'md'].includes(this.getBreakpointSize());
},
};
2016-07-24 16:45:11 -04:00
export default BreakpointInstance;