diff --git a/demo-app/src/app/sidenav/sidenav.component.html b/demo-app/src/app/sidenav/sidenav.component.html index 0434d944..831932d9 100644 --- a/demo-app/src/app/sidenav/sidenav.component.html +++ b/demo-app/src/app/sidenav/sidenav.component.html @@ -14,7 +14,7 @@
Fixed navigation
Hidden navigation

- The side navigation will be hidden on all screen resolution if fixed property is either omitted or false on the mz-sidenav component. To be able to toggle the side navigation visibility add a mz-button component and supply the button id trought the collapseButtonId property of the mz-sidenav component. The class show-on-large will automatically be applied on the button to make it visible on all screen resolutions when fixed property is not provided or false. + The side navigation will be hidden on all screen resolution if fixed property is either omitted or false on the mz-sidenav component. To be able to toggle the side navigation visibility add a mz-button component and supply the button id trought the collapseButtonId property of the mz-sidenav component.

diff --git a/src/app/sidenav/sidenav.component.ts b/src/app/sidenav/sidenav.component.ts index c521af08..72ffd3cf 100644 --- a/src/app/sidenav/sidenav.component.ts +++ b/src/app/sidenav/sidenav.component.ts @@ -46,11 +46,6 @@ export class MzSidenavComponent implements AfterViewInit, OnDestroy { ? $(`#${this.collapseButtonId}`) : $(document.createElement('template')); - // make collapse button visible on all resolution if side navigation is not fixed - if (!this.fixed) { - this.collapseButton.addClass('show-on-large'); - } - // add data-activates to collapse button this.collapseButton.attr('data-activates', this.id); diff --git a/src/app/sidenav/sidenav.component.unit.spec.ts b/src/app/sidenav/sidenav.component.unit.spec.ts index ca48661a..239dbe4c 100644 --- a/src/app/sidenav/sidenav.component.unit.spec.ts +++ b/src/app/sidenav/sidenav.component.unit.spec.ts @@ -86,14 +86,6 @@ describe('MzSidenavComponent:unit', () => { createCollapseButton(collapseButtonId); }); - it('should not add show-on-large css class on collapsable button when fixed', () => { - - component.fixed = true; - component.initCollapseButton(); - - expect(queryById(collapseButtonId)[0].classList).not.toContain('show-on-large'); - }); - it('should not add data-activates attribute on collapse button', () => { component.id = 'sidenav-id'; @@ -132,22 +124,6 @@ describe('MzSidenavComponent:unit', () => { component.collapseButtonId = collapseButtonId; }); - it('should not add show-on-large css class on collapsable button when fixed', () => { - - component.fixed = true; - component.initCollapseButton(); - - expect(queryById(collapseButtonId)[0].classList).not.toContain('show-on-large'); - }); - - it('should add show-on-large css class on collapsable button when not fixed', () => { - - component.initCollapseButton(); - - expect(component.fixed).toBeFalsy(); - expect(queryById(collapseButtonId)[0].classList).toContain('show-on-large'); - }); - it('should add data-activates attribute on collapse button', () => { const sidenavId = 'sidenav-id';