mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
make default
platform fallback
This commit is contained in:
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user