mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +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)
|
||||
// and convert Ionic.config into a ConfigApi that has a get() fn
|
||||
Context.config = createConfigController(
|
||||
Ionic.config = Context.config = createConfigController(
|
||||
Ionic.config,
|
||||
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>
|
||||
// which could have been set by the user, or by prerendering
|
||||
// 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>
|
||||
document.documentElement.setAttribute('mode', Context.mode);
|
||||
document.documentElement.setAttribute('mode', Ionic.mode);
|
||||
|
Reference in New Issue
Block a user