make default platform fallback

This commit is contained in:
Andrew
2015-03-27 18:57:03 -06:00
parent 042c567a50
commit e31c18311a
2 changed files with 11 additions and 3 deletions

View File

@ -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;
}
});

View File

@ -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;
});
}