Skip to content

Instantly share code, notes, and snippets.

@danscotton
Created June 1, 2012 16:06
Show Gist options
  • Save danscotton/2853216 to your computer and use it in GitHub Desktop.
Save danscotton/2853216 to your computer and use it in GitHub Desktop.
// device.config.js
define(['module/config/config'], function( config ) {
// some logic up somewhere
var device;
switch(true) {
case (screen.width > 1200): device = 'wide'; break;
case (screen.width > 640): device = 'tablet'; break;
...
}
config({
device: device
});
});
// touch.config.js
define('module/config/config', function( config ) {
config({
isTouch: // logic in here
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment