- Created a new mixin (ExpandSidenavMixin) that sets the defaultVisible prop that can be used in both the root component and the SidenavToggler. This makes it so that the Root knows whether or not the sidenav is collapsed or expanded, so then child components can use this to calculate margins/paddings/offsets/etc. - Added new classes for the .action-group-footer that set the elements padding based on whether or not the sidenav is expanded. - Added a nested div (.action-group-footer--container) inside .action-group-footer which sets the max width
22 lines
530 B
JavaScript
22 lines
530 B
JavaScript
import ExpandSidenavMixin from '../mixins/expand_sidenav'
|
|
import ToggleMixin from '../mixins/toggle'
|
|
|
|
export default {
|
|
name: 'sidenav-toggler',
|
|
|
|
mixins: [ExpandSidenavMixin, ToggleMixin],
|
|
|
|
mounted: function() {
|
|
this.$parent.$emit('sidenavToggle', this.isVisible)
|
|
},
|
|
|
|
methods: {
|
|
toggle: function(e) {
|
|
e.preventDefault()
|
|
this.isVisible = !this.isVisible
|
|
document.cookie = this.cookieName + '=' + this.isVisible + '; path=/'
|
|
this.$parent.$emit('sidenavToggle', this.isVisible)
|
|
},
|
|
},
|
|
}
|