Skip to content

Commit

Permalink
fix(sidenav): fixes sidenav RTL listening for side mode (#465)
Browse files Browse the repository at this point in the history
closes #411
  • Loading branch information
robertmesserle authored and jelbourn committed May 19, 2016
1 parent 9e308a6 commit 4e1d85e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 2 additions & 7 deletions src/components/sidenav/sidenav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Component,
ContentChildren,
ElementRef,
Host,
HostBinding,
Input,
Optional,
Expand All @@ -19,15 +18,13 @@ import {PromiseCompleter} from '@angular2-material/core/async/promise-completer'
import {MdError} from '@angular2-material/core/errors/error';
import { BooleanFieldValue } from '@angular2-material/core/annotations/field-value';


/** Exception thrown when two MdSidenav are matching the same side. */
export class MdDuplicatedSidenavError extends MdError {
constructor(align: string) {
super(`A sidenav was already declared for 'align="${align}"'`);
}
}


/**
* <md-sidenav> component.
*
Expand Down Expand Up @@ -223,8 +220,6 @@ export class MdSidenav {
private _closePromiseReject: () => void;
}



/**
* <md-sidenav-layout> component.
*
Expand Down Expand Up @@ -263,12 +258,12 @@ export class MdSidenavLayout implements AfterContentInit {
private _left: MdSidenav;
private _right: MdSidenav;

constructor(@Optional() @Host() private _dir: Dir, private _element: ElementRef,
constructor(@Optional() private _dir: Dir, private _element: ElementRef,
private _renderer: Renderer) {
// If a `Dir` directive exists up the tree, listen direction changes and update the left/right
// properties to point to the proper start/end.
if (_dir != null) {
_dir.dirChange.add(() => this._validateDrawers());
_dir.dirChange.subscribe(() => this._validateDrawers());
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/demo-app/sidenav/sidenav-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {MdButton} from '@angular2-material/button/button';
import {MD_SIDENAV_DIRECTIVES} from '@angular2-material/sidenav/sidenav';

@Component({
moduleId: module.id,
selector: 'sidenav-demo',
templateUrl: 'sidenav-demo.html',
styleUrls: ['sidenav-demo.css'],
directives: [MD_SIDENAV_DIRECTIVES, MdButton]
moduleId: module.id,
selector: 'sidenav-demo',
templateUrl: 'sidenav-demo.html',
styleUrls: ['sidenav-demo.css'],
directives: [MD_SIDENAV_DIRECTIVES, MdButton]
})
export class SidenavDemo { }
export class SidenavDemo {}

0 comments on commit 4e1d85e

Please sign in to comment.