mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(transition): pass isRTL in transition opts
This commit is contained in:
@@ -794,6 +794,9 @@ export class NavController extends Ion {
|
||||
// init the transition animation
|
||||
opts.renderDelay = opts.transitionDelay || self._trnsDelay;
|
||||
|
||||
// set if this app is right-to-left or not
|
||||
opts.isRTL = this.config.platform.isRTL();
|
||||
|
||||
let transAnimation = Animation.createTransition(enteringView,
|
||||
leavingView,
|
||||
opts);
|
||||
|
||||
@@ -91,8 +91,8 @@ function setupDom(window, document, config, platform, clickBlock, featureDetect)
|
||||
bodyEle.classList.add(mode);
|
||||
|
||||
// right-to-left language direction
|
||||
platform.setDir(document.dir);
|
||||
if (platform.isRTL()) {
|
||||
if (document.dir === 'rtl') {
|
||||
platform.setIsRTL(true);
|
||||
bodyEle.classList.add('rtl');
|
||||
}
|
||||
|
||||
|
||||
@@ -200,8 +200,8 @@ export class Config {
|
||||
let platformModeValue = undefined;
|
||||
let configObj = null;
|
||||
|
||||
if (this._platform) {
|
||||
let queryStringValue = this._platform.query('ionic' + key.toLowerCase());
|
||||
if (this.platform) {
|
||||
let queryStringValue = this.platform.query('ionic' + key.toLowerCase());
|
||||
if (isDefined(queryStringValue)) {
|
||||
return this._c[key] = (queryStringValue === 'true' ? true : queryStringValue === 'false' ? false : queryStringValue);
|
||||
}
|
||||
@@ -211,7 +211,7 @@ export class Config {
|
||||
|
||||
// array of active platforms, which also knows the hierarchy,
|
||||
// with the last one the most important
|
||||
let activePlatformKeys = this._platform.platforms();
|
||||
let activePlatformKeys = this.platform.platforms();
|
||||
|
||||
// loop through all of the active platforms we're on
|
||||
for (let i = 0, l = activePlatformKeys.length; i < l; i++) {
|
||||
@@ -272,7 +272,7 @@ export class Config {
|
||||
// or it was from the default platform configs
|
||||
// in that order
|
||||
if (isFunction(this._c[key])) {
|
||||
return this._c[key](this._platform);
|
||||
return this._c[key](this.platform);
|
||||
}
|
||||
|
||||
return this._c[key];
|
||||
@@ -282,7 +282,7 @@ export class Config {
|
||||
* @private
|
||||
*/
|
||||
setPlatform(platform) {
|
||||
this._platform = platform;
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
static setModeConfig(mode, config) {
|
||||
|
||||
@@ -26,7 +26,7 @@ export class Platform {
|
||||
constructor(platforms=[]) {
|
||||
this._platforms = platforms;
|
||||
this._versions = {};
|
||||
this._dir = 'ltr';
|
||||
this._isRTL = false;
|
||||
this._onResizes = [];
|
||||
|
||||
this._readyPromise = new Promise(res => { this._readyResolve = res; } );
|
||||
@@ -173,14 +173,14 @@ export class Platform {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isRTL() {
|
||||
return (this._dir === 'rtl');
|
||||
return this._isRTL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setDir(dir) {
|
||||
this._dir = dir.toLowerCase();
|
||||
setIsRTL(val) {
|
||||
this._isRTL = val;
|
||||
}
|
||||
|
||||
// Methods meant to be overridden by the engine
|
||||
|
||||
Reference in New Issue
Block a user