mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
set view transition by config
This commit is contained in:
@ -152,7 +152,7 @@ export function ionicBootstrap(ComponentType, config) {
|
||||
config.setPlatform(Platform);
|
||||
|
||||
// make the config global
|
||||
GlobalIonicConfig = config;
|
||||
IonicConfig.setGlobal(config);
|
||||
|
||||
// config and platform settings have been figured out
|
||||
// apply the correct CSS to the app
|
||||
@ -196,5 +196,3 @@ export function load(app) {
|
||||
app.main(ionicBootstrap);
|
||||
}
|
||||
}
|
||||
|
||||
export let GlobalIonicConfig = null;
|
||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
|
||||
import * as util from 'ionic/util';
|
||||
import {GlobalIonicConfig} from '../components/app/app';
|
||||
import {IonicConfig} from './config';
|
||||
import {
|
||||
Aside, Content, Refresher,
|
||||
Slides, Slide, SlidePager,
|
||||
@ -100,9 +100,9 @@ function appendModeConfig(ComponentType) {
|
||||
}
|
||||
|
||||
// get the property values from a global user/platform config
|
||||
let configVal = GlobalIonicConfig.setting(prop);
|
||||
let configVal = IonicConfig.global.setting(prop);
|
||||
if (configVal) {
|
||||
instance[prop] = globalPropertyValue;
|
||||
instance[prop] = configVal;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ function appendModeConfig(ComponentType) {
|
||||
}
|
||||
|
||||
if (!platformMode) {
|
||||
platformMode = GlobalIonicConfig.setting('mode');
|
||||
platformMode = IonicConfig.global.setting('mode');
|
||||
}
|
||||
|
||||
let id = config.classId || (config.selector && config.selector.replace('ion-', ''));
|
||||
|
@ -12,7 +12,7 @@ export class IonicConfig {
|
||||
|
||||
// override defaults w/ user config
|
||||
if (settings) {
|
||||
extend(this._settings, setting);
|
||||
extend(this._settings, settings);
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,4 +125,14 @@ export class IonicConfig {
|
||||
this._settings.platforms = extend(platform.settings(), this._settings.platforms || {});
|
||||
}
|
||||
|
||||
static setGlobal(config) {
|
||||
globalConfig = config;
|
||||
}
|
||||
|
||||
static get global() {
|
||||
return globalConfig;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export let globalConfig = null;
|
||||
|
@ -70,6 +70,7 @@ Platform.register({
|
||||
],
|
||||
settings: {
|
||||
mode: 'ios',
|
||||
viewTransition: 'ios',
|
||||
tapPolyfill: true
|
||||
},
|
||||
isMatch(p) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Animation} from '../animations/animation';
|
||||
import {IonicConfig} from '../config/config';
|
||||
|
||||
const SHOW_NAVBAR_CSS = 'show-navbar';
|
||||
const SHOW_VIEW_CSS = 'show-view';
|
||||
@ -84,7 +85,7 @@ export class Transition extends Animation {
|
||||
STATIC CLASSES
|
||||
*/
|
||||
static create(nav, opts = {}) {
|
||||
const name = opts.animation || 'ios';
|
||||
const name = opts.animation || IonicConfig.global.setting('viewTransition');
|
||||
|
||||
let TransitionClass = TransitionRegistry[name];
|
||||
if (!TransitionClass) {
|
||||
|
Reference in New Issue
Block a user