mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
ADAM CLICK
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import * as util from '../util/util';
|
||||
|
||||
import {Tap} from '../util/tap';
|
||||
|
||||
let registry = {};
|
||||
let defaultPlatform;
|
||||
@ -61,6 +61,10 @@ class PlatformController {
|
||||
return null;
|
||||
}
|
||||
|
||||
is(name) {
|
||||
return activePlatform.name === name;
|
||||
}
|
||||
|
||||
_applyBodyClasses() {
|
||||
if(!activePlatform) {
|
||||
return;
|
||||
@ -68,6 +72,10 @@ class PlatformController {
|
||||
|
||||
document.body.classList.add('platform-' + activePlatform.name);
|
||||
}
|
||||
|
||||
run() {
|
||||
activePlatform && activePlatform.run();
|
||||
}
|
||||
}
|
||||
|
||||
export let Platform = new PlatformController((util.getQuerystring('ionicplatform')).toLowerCase(), window.navigator.userAgent);
|
||||
@ -81,6 +89,9 @@ Platform.register({
|
||||
return platformQuerystring == 'android';
|
||||
}
|
||||
return /android/i.test(userAgent);
|
||||
},
|
||||
run() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@ -91,6 +102,9 @@ Platform.register({
|
||||
return platformQuerystring == 'ios';
|
||||
}
|
||||
return /ipad|iphone|ipod/i.test(userAgent);
|
||||
},
|
||||
run() {
|
||||
//Tap.run();
|
||||
}
|
||||
});
|
||||
|
||||
@ -99,4 +113,6 @@ Platform.setDefault({
|
||||
name: 'ios'
|
||||
});
|
||||
|
||||
Platform.set( Platform.get('ios') );//Platform.detect() );
|
||||
Platform.set( Platform.getPlatform('ios') );//Platform.detect() );
|
||||
|
||||
Platform.run();
|
||||
|
Reference in New Issue
Block a user