Last active
August 29, 2015 14:01
-
-
Save erikakers/ec5032eff5d00786c274 to your computer and use it in GitHub Desktop.
Responsive Width Conditions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.Helpers.checkWidth = (function(conds) { | |
conds.init = function() { | |
$.subscribe('resize', function(){ | |
console.log('resize event fired'); | |
App.Helpers.getWidth(); | |
// if mobile width, mobile media query or mobile ua returns true, broadcast a resize:mobile event | |
if ( App.Devices.mobile || App.Devices.mobileMQ || App.Devices.mobileCheck ) $.publish('resize:mobile'); | |
// if we are in the tablet realm, lets publish that | |
if ( App.Devices.tablet || App.Devices.tabletMQ ) $.publish('resize:tablet'); | |
}); | |
}; | |
return conds; | |
}(App.Helpers.checkWidth || {})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment