(js) Automatically close sidenav on small devices

pull/186/head
Francis Lachapelle 2015-12-18 11:43:05 -05:00
parent 530e7a9d99
commit 80533a6f9a
2 changed files with 6 additions and 3 deletions

View File

@ -31,7 +31,7 @@
vm.editMode = false;
AddressBook.$query.value = '';
// Close sidenav on small devices
if ($mdMedia('sm'))
if ($mdMedia('xs'))
$mdSidenav('left').close();
$state.go('app.addressbook', {addressbookId: folder.id});
}

View File

@ -7,8 +7,8 @@
/**
* @ngInject
*/
PreferencesController.$inject = ['$q', '$window', '$state', '$mdDialog', '$mdToast', 'sgFocus', 'Dialog', 'User', 'Account', 'statePreferences', 'Authentication'];
function PreferencesController($q, $window, $state, $mdDialog, $mdToast, focus, Dialog, User, Account, statePreferences, Authentication) {
PreferencesController.$inject = ['$q', '$window', '$state', '$mdMedia', '$mdSidenav', '$mdDialog', '$mdToast', 'sgFocus', 'Dialog', 'User', 'Account', 'statePreferences', 'Authentication'];
function PreferencesController($q, $window, $state, $mdMedia, $mdSidenav, $mdDialog, $mdToast, focus, Dialog, User, Account, statePreferences, Authentication) {
var vm = this, account, mailboxes = [];
vm.preferences = statePreferences;
@ -56,6 +56,9 @@
});
function go(module) {
// Close sidenav on small devices
if ($mdMedia('xs'))
$mdSidenav('left').close();
$state.go('preferences.' + module);
}