0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/utils/mobile.js

18 lines
438 B
JavaScript
Raw Normal View History

var mobileQuery = matchMedia('(max-width: 900px)'),
responsiveAction = function responsiveAction(event, mediaCondition, cb) {
if (!window.matchMedia(mediaCondition).matches) {
return;
}
event.preventDefault();
event.stopPropagation();
cb();
};
export { mobileQuery, responsiveAction };
export default {
mobileQuery: mobileQuery,
responsiveAction: responsiveAction
};