Compare View
Commits (3)
Diff
Showing 1 changed file Side-by-side Diff
scripts/SettingsController.js
View file @
8a9a3e9
... | ... | @@ -44,9 +44,12 @@ angular.module('flashy.SettingsController', ['ui.router']). |
44 | 44 | |
45 | 45 | |
46 | 46 | console.log('checking to see if chrome'); |
47 | - if (true/*!chrome*/) { | |
47 | + | |
48 | + if (!chrome) { | |
49 | + pushSwitch.disabled = true; | |
48 | 50 | return; |
49 | 51 | } |
52 | + | |
50 | 53 | console.log('chrome'); |
51 | 54 | |
52 | 55 | console.log('executing things outside of module'); |
... | ... | @@ -309,9 +312,21 @@ angular.module('flashy.SettingsController', ['ui.router']). |
309 | 312 | } |
310 | 313 | |
311 | 314 | var enablePushSwitch = $('.js-checkbox'); |
315 | + | |
312 | 316 | var pushSwitch = document.getElementById("notifbox"); |
313 | 317 | pushSwitch.disabled = true; |
314 | 318 | |
319 | + var ua = navigator.userAgent.toLowerCase(); | |
320 | + var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); | |
321 | + | |
322 | + if(!isAndroid) { | |
323 | + // Do something! | |
324 | + // Redirect to Android-site? | |
325 | + pushSwitch.disabled = true; | |
326 | + console.log("not android"); | |
327 | + return; | |
328 | + } | |
329 | + | |
315 | 330 | enablePushSwitch.change(function(e) { |
316 | 331 | console.log('checkbox changed'); |
317 | 332 | if (e.target.checked) { |