Permalink
Browse files

replaced app.os with app.device.os

Signed-off-by: Jonathan Fielding <j.fielding@me.com>
  • Loading branch information...
1 parent a362eef commit 3354d2bfede726c2b4bb6bfcf88671dce7837dfe @jonathan-fielding committed Mar 7, 2012
Showing with 7 additions and 7 deletions.
  1. +4 −4 assets/js/AppBoilerplate.js
  2. +3 −3 plugins/theme_switcher/theme_switcher.js
View
8 assets/js/AppBoilerplate.js
@@ -6,23 +6,23 @@ var app = function(){
var getOS = function(){
//Sniff the OS, (naughty but necessary for some functionality)
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
- app.os = 'iOS';
+ app.device.os = 'iOS';
}
if((navigator.userAgent.match(/Android/i))) {
- app.os = 'Android';
+ app.device.os = 'Android';
}
if((navigator.userAgent.match(/Windows Phone OS/i))) {
- app.os = 'Windows Mobile';
+ app.device.os = 'Windows Mobile';
}
};
return {
'url_path': '',
'theme':'',
- 'os':'',
+ 'device':{'os':'','type':''},
init: function(event, eventData){
var module_name = $(eventData.toPage).attr('data-module');
var javascript_required = module_name +'.js'
View
6 plugins/theme_switcher/theme_switcher.js
@@ -14,23 +14,23 @@ app.theme_switcher = function(){
'winmob_theme' : '',
init: function(){
- if(app.os === 'iOS'){
+ if(app.device.os === 'iOS'){
if(app.theme_switcher.iOS_theme != ''){
app.theme = app.theme_switcher.iOS_theme;
}
else{
app.theme = app.theme_switcher.default_theme;
}
}
- else if (app.os === 'Android') {
+ else if (app.device.os === 'Android') {
if(app.theme_switcher.android_theme != ''){
app.theme = app.theme_switcher.android_theme;
}
else{
app.theme = app.theme_switcher.default_theme;
}
}
- else if (app.os === 'Windows Mobile') {
+ else if (app.device.os === 'Windows Mobile') {
if(app.theme_switcher.winmob_theme != ''){
app.theme = app.theme_switcher.winmob_theme;
}

0 comments on commit 3354d2b

Please sign in to comment.