Picture of Andre Lung
Move drawer and navigation-drawer-toggle-button to the left side
by Andre Lung - Sunday, 11 February 2018, 12:11 PM
 

Hi all,

I am looking for a convenient way to move the drawer-icon and the opening drawer to the left side. So far, I saw this working by changing the 

this.drawerDir = 'right';

in the core's drawerView.js (and 2 less changes). I don't think, that this is the smart way and I would like to move this to the template or to a plugin. Do you know if this is possible?

Picture of Victoria Forman
Re: Move drawer and navigation-drawer-toggle-button to the left side
by Victoria Forman - Monday, 12 February 2018, 12:37 PM
 

Hi Andre,

I have the same task to solve and have not a perfect solution.   

I'am using this code now in drawerView.js (after line17)
 if(Adapt.config.get('_drawer')._drawerPosition=='left'){
                this.drawerDir = 'left';

                //adding class to move drawer-icon to the left
                $('#adapt').addClass('drawer-left');
 }

new attribute _drawerPosition for _drawer in config.json

"_drawer": {
        "_showEasing": "easeOutQuart",
        "_hideEasing": "easeInQuart",
        "_duration": 400,
        "_drawerPosition":"left"
    }

and in LESS

.drawer-left .navigation .navigation-drawer-toggle-button{

float: left;

}

but of course you need to be carefull with updates and its not the solution for Authoring Tool.

Maybe someone has a better way to do this? Like overwrite DrawerView initialize function with theme or plugin would be nice - and not only in this case.

 

 

Picture of Matt Leathes
Re: Move drawer and navigation-drawer-toggle-button to the left side
by Matt Leathes - Monday, 12 February 2018, 1:12 PM
 

Sounds to me like this should be a feature request for a future version of Adapt...

Picture of Andre Lung
Re: Move drawer and navigation-drawer-toggle-button to the left side
by Andre Lung - Thursday, 22 February 2018, 7:13 AM
 

Hi Victoria,

this approach adds the ability to configure the drawer per-project. I guess this is better than the approach we use right now. However, moving it to the theme would be perfect. 

As far as I understand, the main problem with moving it to the theme are the animations set in the drawerView.js. Is there maybe a way to include a custom drawerView.js in the theme?