From e31c18311a07b6340f0e9806cfd892c44e516def Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 27 Mar 2015 18:57:03 -0600 Subject: [PATCH] make `default` platform fallback --- src/platform/platform.js | 10 +++++++++- src/util.js | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/platform/platform.js b/src/platform/platform.js index d8b8314b8c..60efbc3177 100644 --- a/src/platform/platform.js +++ b/src/platform/platform.js @@ -54,7 +54,15 @@ platform.register({ name: 'ios', // For now always default to ios matcher() { - return window.IONIC_PLATFORM === 'ios'; + return window.IONIC_PLATFORM === 'ios' || /ipad|iphone|ipod/i.test(ua); + } +}); + +// Last case is a catch-all +platform.register({ + name: 'default', + matcher() { + return true; } }); diff --git a/src/util.js b/src/util.js index 596ac8c34c..33d457b83c 100644 --- a/src/util.js +++ b/src/util.js @@ -34,14 +34,14 @@ export let isDefined = val => typeof val === 'undefined'; export let isObject = val => typeof val === 'object'; export function pascalCaseToDashCase(str = '') { - return str.charAt(0).toLowerCase() + str.substring(1).replace(/[A-Z]/g, function(match) { + return str.charAt(0).toLowerCase() + str.substring(1).replace(/[A-Z]/g, match => { return '-' + match.toLowerCase() }) } export let array = { unique(array) { - return array.filter(function(value, index) { + return array.filter((value, index) => { return array.indexOf(value) === index; }); }