fix(menu): rtl support

This commit is contained in:
Manu Mtz.-Almeida
2017-04-24 01:02:20 +02:00
parent 51d507998c
commit 53113366e2
16 changed files with 129 additions and 138 deletions

View File

@ -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