mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(global): add mode and config to Ionic global
This commit is contained in:
@ -14,7 +14,7 @@ if (!Context.dom) {
|
|||||||
|
|
||||||
// create the Ionic.config from raw config object (if it exists)
|
// create the Ionic.config from raw config object (if it exists)
|
||||||
// and convert Ionic.config into a ConfigApi that has a get() fn
|
// and convert Ionic.config into a ConfigApi that has a get() fn
|
||||||
Context.config = createConfigController(
|
Ionic.config = Context.config = createConfigController(
|
||||||
Ionic.config,
|
Ionic.config,
|
||||||
detectPlatforms(window.location.href, window.navigator.userAgent, PLATFORM_CONFIGS, 'core')
|
detectPlatforms(window.location.href, window.navigator.userAgent, PLATFORM_CONFIGS, 'core')
|
||||||
);
|
);
|
||||||
@ -23,7 +23,7 @@ Context.config = createConfigController(
|
|||||||
// first see if the mode was set as an attribute on <html>
|
// first see if the mode was set as an attribute on <html>
|
||||||
// which could have been set by the user, or by prerendering
|
// which could have been set by the user, or by prerendering
|
||||||
// otherwise get the mode via config settings, and fallback to md
|
// otherwise get the mode via config settings, and fallback to md
|
||||||
Context.mode = document.documentElement.getAttribute('mode') || Context.config.get('mode', 'md');
|
Ionic.mode = Context.mode = document.documentElement.getAttribute('mode') || Context.config.get('mode', 'md');
|
||||||
|
|
||||||
// ensure we've got the mode attribute set on <html>
|
// ensure we've got the mode attribute set on <html>
|
||||||
document.documentElement.setAttribute('mode', Context.mode);
|
document.documentElement.setAttribute('mode', Ionic.mode);
|
||||||
|
Reference in New Issue
Block a user