-
+ arrow_backStyle Guide
diff --git a/src/platform/core/layout/README.md b/src/platform/core/layout/README.md
index f6bed416f4..968cb22970 100644
--- a/src/platform/core/layout/README.md
+++ b/src/platform/core/layout/README.md
@@ -27,12 +27,20 @@ Example for Main Layout:
```
-To toggle the main sidenav from child layouts/components, you can use the `[tdLayoutToggle]` directive on any element and its click event will trigger the toggle.
+To toggle/close/open the main sidenav from child layouts/components, you can use the `[tdLayoutToggle]`, `[tdLayoutClose]` or `[tdLayoutOpen]` directives on any element and its click event will trigger the sidenav action.
Example:
```html
-
+ // or tdLayoutOpen / tdLayoutClose
+ menu
+
+```
+
+To disable the sidenav action, just set the input to false.
+
+```html
+menu
```
diff --git a/src/platform/core/layout/layout-manage-list/README.md b/src/platform/core/layout/layout-manage-list/README.md
index df7592f288..50e4636335 100644
--- a/src/platform/core/layout/layout-manage-list/README.md
+++ b/src/platform/core/layout/layout-manage-list/README.md
@@ -14,12 +14,20 @@
## Usage
-To toggle the manage list sidenav from child layouts/components, you can use the `[tdLayoutManageListToggle]` directive on any element and its click event will trigger the toggle.
+To toggle/close/open the manage list sidenav from child layouts/components, you can use the `[tdLayoutManageListToggle]`, `[tdLayoutManageListClose]` or `[tdLayoutManageListOpen]` directives on any element and its click event will trigger the sidenav action.
Example:
```html
-
+ // or tdLayoutManageListOpen / tdLayoutManageListClose
+ menu
+
+```
+
+To disable the sidenav action, just set the input to false.
+
+```html
+menu
```
@@ -32,6 +40,10 @@ Example:
`[tdLayoutManageListToggle]` is used to add the sidenav toggle behavior to any clickable element.
+`[tdLayoutManageListClose]` is used to add the sidenav close behavior to any clickable element.
+
+`[tdLayoutManageListOpen]` is used to add the sidenav open behavior to any clickable element.
+
Example for Manage List Layout / Nav Layout combo:
```html
@@ -47,7 +59,7 @@ Example for Manage List Layout / Nav Layout combo:
... sidenav content
-
+ arrow_back
... sub toolbar content
diff --git a/src/platform/core/layout/layout-manage-list/layout-manage-list.component.ts b/src/platform/core/layout/layout-manage-list/layout-manage-list.component.ts
index b13eecd616..b34d9c4f0f 100644
--- a/src/platform/core/layout/layout-manage-list/layout-manage-list.component.ts
+++ b/src/platform/core/layout/layout-manage-list/layout-manage-list.component.ts
@@ -1,19 +1,8 @@
-import { Component, Directive, Input, ViewChild, Inject, forwardRef, Renderer2, ElementRef } from '@angular/core';
+import { Component, Directive, Input, ViewChild } from '@angular/core';
import { MdSidenav, MdSidenavToggleResult } from '@angular/material';
-import { LayoutToggle, ILayoutTogglable } from '../layout-toggle.class';
-
-@Directive({
- selector: '[tdLayoutManageListToggle]',
-})
-export class TdLayoutManageListToggleDirective extends LayoutToggle {
- constructor(@Inject(forwardRef(() => TdLayoutManageListComponent)) layout: TdLayoutManageListComponent,
- renderer: Renderer2,
- elementRef: ElementRef) {
- super(layout, renderer, elementRef);
- }
-}
+import { ILayoutTogglable } from '../layout-toggle.class';
@Component({
selector: 'td-layout-manage-list',
@@ -22,7 +11,7 @@ export class TdLayoutManageListToggleDirective extends LayoutToggle {
})
export class TdLayoutManageListComponent implements ILayoutTogglable {
- @ViewChild(MdSidenav) _sideNav: MdSidenav;
+ @ViewChild(MdSidenav) sidenav: MdSidenav;
/**
* mode?: 'side', 'push' or 'over'
@@ -69,21 +58,21 @@ export class TdLayoutManageListComponent implements ILayoutTogglable {
* Proxy toggle method to access sidenav from outside (from td-layout template).
*/
public toggle(): Promise {
- return this._sideNav.toggle(!this._sideNav.opened);
+ return this.sidenav.toggle(!this.sidenav.opened);
}
/**
* Proxy open method to access sidenav from outside (from td-layout template).
*/
public open(): Promise {
- return this._sideNav.open();
+ return this.sidenav.open();
}
/**
* Proxy close method to access sidenav from outside (from td-layout template).
*/
public close(): Promise {
- return this._sideNav.close();
+ return this.sidenav.close();
}
}
diff --git a/src/platform/core/layout/layout-manage-list/layout-manage-list.directives.ts b/src/platform/core/layout/layout-manage-list/layout-manage-list.directives.ts
new file mode 100644
index 0000000000..467ccc8d3d
--- /dev/null
+++ b/src/platform/core/layout/layout-manage-list/layout-manage-list.directives.ts
@@ -0,0 +1,66 @@
+import { Directive, Input, Renderer2, ElementRef, Inject, forwardRef } from '@angular/core';
+import { TdLayoutManageListComponent } from './layout-manage-list.component';
+import { LayoutToggle } from '../layout-toggle.class';
+
+@Directive({
+ selector: '[tdLayoutManageListToggle]',
+})
+export class TdLayoutManageListToggleDirective extends LayoutToggle {
+
+ @Input('tdLayoutManageListToggle')
+ set tdLayoutManageListToggle(tdLayoutManageListToggle: boolean) {
+ this.disabled = !(tdLayoutManageListToggle === '' || tdLayoutManageListToggle);
+ }
+
+ constructor(@Inject(forwardRef(() => TdLayoutManageListComponent)) layout: TdLayoutManageListComponent,
+ renderer: Renderer2,
+ elementRef: ElementRef) {
+ super(layout, renderer, elementRef);
+ }
+
+ onClick(): void {
+ this._layout.toggle();
+ }
+}
+
+@Directive({
+ selector: '[tdLayoutManageListClose]',
+})
+export class TdLayoutManageListCloseDirective extends LayoutToggle {
+
+ @Input('tdLayoutManageListClose')
+ set tdLayoutManageListClose(tdLayoutManageListClose: boolean) {
+ this.disabled = !(tdLayoutManageListClose === '' || tdLayoutManageListClose);
+ }
+
+ constructor(@Inject(forwardRef(() => TdLayoutManageListComponent)) layout: TdLayoutManageListComponent,
+ renderer: Renderer2,
+ elementRef: ElementRef) {
+ super(layout, renderer, elementRef);
+ }
+
+ onClick(): void {
+ this._layout.close();
+ }
+}
+
+@Directive({
+ selector: '[tdLayoutManageListOpen]',
+})
+export class TdLayoutManageListOpenDirective extends LayoutToggle {
+
+ @Input('tdLayoutManageListOpen')
+ set tdLayoutManageListOpen(tdLayoutManageListOpen: boolean) {
+ this.disabled = !(tdLayoutManageListOpen === '' || tdLayoutManageListOpen);
+ }
+
+ constructor(@Inject(forwardRef(() => TdLayoutManageListComponent)) layout: TdLayoutManageListComponent,
+ renderer: Renderer2,
+ elementRef: ElementRef) {
+ super(layout, renderer, elementRef);
+ }
+
+ onClick(): void {
+ this._layout.open();
+ }
+}
diff --git a/src/platform/core/layout/layout-nav-list/README.md b/src/platform/core/layout/layout-nav-list/README.md
index bdb46b4870..ac3a805eca 100644
--- a/src/platform/core/layout/layout-nav-list/README.md
+++ b/src/platform/core/layout/layout-nav-list/README.md
@@ -19,12 +19,20 @@
## Usage
-To toggle the nav list sidenav from child layouts/components, you can use the `[tdLayoutNavListToggle]` directive on any element and its click event will trigger the toggle.
+To toggle/close/open the nav list sidenav from child layouts/components, you can use the `[tdLayoutNavListToggle]`, `[tdLayoutNavListClose]` or `[tdLayoutNavListOpen]` directives on any element and its click event will trigger the sidenav action.
Example:
```html
-
+ // or tdLayoutNavListOpen / tdLayoutNavListClose
+ menu
+
+```
+
+To disable the sidenav action, just set the input to false.
+
+```html
+menu
```
@@ -43,6 +51,10 @@ Example:
`[tdLayoutNavListToggle]` is used to add the sidenav toggle behavior to any clickable element.
+`[tdLayoutNavListClose]` is used to add the sidenav close behavior to any clickable element.
+
+`[tdLayoutNavListOpen]` is used to add the sidenav open behavior to any clickable element.
+
Example for Nav List Layout:
```html
@@ -54,7 +66,7 @@ Example for Nav List Layout:
... left toolbar content