debian-mirror-gitlab/app/assets/javascripts/breakpoints.js

20 lines
375 B
JavaScript
Raw Normal View History

2017-09-10 17:25:29 +05:30
export const breakpoints = {
lg: 1200,
md: 992,
sm: 768,
xs: 0,
};
2016-09-13 17:45:13 +05:30
2017-09-10 17:25:29 +05:30
const BreakpointInstance = {
windowWidth: () => window.innerWidth,
getBreakpointSize() {
const windowWidth = this.windowWidth();
2016-09-13 17:45:13 +05:30
2017-09-10 17:25:29 +05:30
const breakpoint = Object.keys(breakpoints).find(key => windowWidth > breakpoints[key]);
2016-09-13 17:45:13 +05:30
2017-09-10 17:25:29 +05:30
return breakpoint;
},
};
2016-09-13 17:45:13 +05:30
2017-09-10 17:25:29 +05:30
export default BreakpointInstance;