(js) Close sidenav on small devices
This commit is contained in:
parent
b9462ed86d
commit
6918650f5b
|
@ -45,10 +45,10 @@
|
||||||
// templateUrl: 'bottomSheetTemplate.html'
|
// templateUrl: 'bottomSheetTemplate.html'
|
||||||
// });
|
// });
|
||||||
// };
|
// };
|
||||||
$scope.toggleDetailView = function() {
|
// $scope.toggleDetailView = function() {
|
||||||
var detail = angular.element(document.getElementById('detailView'));
|
// var detail = angular.element(document.getElementById('detailView'));
|
||||||
detail.toggleClass('sg-close');
|
// detail.toggleClass('sg-close');
|
||||||
};
|
// };
|
||||||
$scope.$watch(function() {
|
$scope.$watch(function() {
|
||||||
return $mdMedia(sgConstant['gt-md']);
|
return $mdMedia(sgConstant['gt-md']);
|
||||||
}, function(newVal) {
|
}, function(newVal) {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
/**
|
/**
|
||||||
* @ngInject
|
* @ngInject
|
||||||
*/
|
*/
|
||||||
AddressBooksController.$inject = ['$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$mdDialog', '$mdToast', 'FileUploader', 'sgFocus', 'Card', 'AddressBook', 'Dialog', 'sgSettings', 'User', 'stateAddressbooks'];
|
AddressBooksController.$inject = ['$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$mdDialog', '$mdToast', '$mdMedia', '$mdSidenav', 'FileUploader', 'sgFocus', 'Card', 'AddressBook', 'Dialog', 'sgSettings', 'User', 'stateAddressbooks'];
|
||||||
function AddressBooksController($state, $scope, $rootScope, $stateParams, $timeout, $mdDialog, $mdToast, FileUploader, focus, Card, AddressBook, Dialog, Settings, User, stateAddressbooks) {
|
function AddressBooksController($state, $scope, $rootScope, $stateParams, $timeout, $mdDialog, $mdToast, $mdMedia, $mdSidenav, FileUploader, focus, Card, AddressBook, Dialog, Settings, User, stateAddressbooks) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
vm.activeUser = Settings.activeUser;
|
vm.activeUser = Settings.activeUser;
|
||||||
|
@ -30,6 +30,9 @@
|
||||||
vm.editMode != folder.id) {
|
vm.editMode != folder.id) {
|
||||||
vm.editMode = false;
|
vm.editMode = false;
|
||||||
AddressBook.$query.value = '';
|
AddressBook.$query.value = '';
|
||||||
|
// Close sidenav on small devices
|
||||||
|
if ($mdMedia('sm'))
|
||||||
|
$mdSidenav('left').close();
|
||||||
$state.go('app.addressbook', {addressbookId: folder.id});
|
$state.go('app.addressbook', {addressbookId: folder.id});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
/**
|
/**
|
||||||
* @ngInject
|
* @ngInject
|
||||||
*/
|
*/
|
||||||
MailboxesController.$inject = ['$state', '$timeout', '$mdDialog', 'sgFocus', 'encodeUriFilter', 'Dialog', 'sgSettings', 'Account', 'Mailbox', 'VirtualMailbox', 'User', 'Preferences', 'stateAccounts'];
|
MailboxesController.$inject = ['$state', '$timeout', '$mdDialog', '$mdMedia', '$mdSidenav', 'sgFocus', 'encodeUriFilter', 'Dialog', 'sgSettings', 'Account', 'Mailbox', 'VirtualMailbox', 'User', 'Preferences', 'stateAccounts'];
|
||||||
function MailboxesController($state, $timeout, $mdDialog, focus, encodeUriFilter, Dialog, Settings, Account, Mailbox, VirtualMailbox, User, Preferences, stateAccounts) {
|
function MailboxesController($state, $timeout, $mdDialog, $mdMedia, $mdSidenav, focus, encodeUriFilter, Dialog, Settings, Account, Mailbox, VirtualMailbox, User, Preferences, stateAccounts) {
|
||||||
var vm = this,
|
var vm = this,
|
||||||
account,
|
account,
|
||||||
mailbox;
|
mailbox;
|
||||||
|
@ -221,6 +221,9 @@
|
||||||
vm.editMode = false;
|
vm.editMode = false;
|
||||||
vm.showingAdvancedSearch = false;
|
vm.showingAdvancedSearch = false;
|
||||||
vm.service.$virtualMode = false;
|
vm.service.$virtualMode = false;
|
||||||
|
// Close sidenav on small devices
|
||||||
|
if ($mdMedia('sm'))
|
||||||
|
$mdSidenav('left').close();
|
||||||
$state.go('mail.account.mailbox', { accountId: account.id, mailboxId: encodeUriFilter(folder.path) });
|
$state.go('mail.account.mailbox', { accountId: account.id, mailboxId: encodeUriFilter(folder.path) });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue