mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(menu): rtl support
This commit is contained in:
@ -30,6 +30,7 @@ import { removeArrayItem } from '../util/util';
|
||||
* @demo /docs/demos/src/platform/
|
||||
*/
|
||||
export class Platform {
|
||||
|
||||
private _win: Window;
|
||||
private _doc: HTMLDocument;
|
||||
private _versions: {[name: string]: PlatformVersion} = {};
|
||||
@ -50,8 +51,6 @@ export class Platform {
|
||||
private _isPortrait: boolean = null;
|
||||
private _uiEvtOpts = false;
|
||||
|
||||
static dirChanged: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
/** @hidden */
|
||||
zone: NgZone;
|
||||
|
||||
@ -318,8 +317,8 @@ export class Platform {
|
||||
* @param {boolean} updateDocument
|
||||
*/
|
||||
setDir(dir: string, updateDocument: boolean) {
|
||||
this._dir = (dir || '').toLowerCase();
|
||||
Platform.dirChanged.emit(this._dir);
|
||||
this._dir = dir = (dir || '').toLowerCase();
|
||||
this.isRTL = (dir === 'rtl');
|
||||
|
||||
if (updateDocument !== false) {
|
||||
this._doc['documentElement'].setAttribute('dir', dir);
|
||||
@ -344,9 +343,7 @@ export class Platform {
|
||||
* [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isRTL(): boolean {
|
||||
return (this._dir === 'rtl');
|
||||
}
|
||||
isRTL: boolean;
|
||||
|
||||
/**
|
||||
* Set the app's language and optionally the country code, which will update
|
||||
|
Reference in New Issue
Block a user