|
|
|
@ -118,13 +118,22 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
|
|
|
function baUiSrefToggler() {
|
|
|
|
|
function baUiSrefToggler(baSidebarService) {
|
|
|
|
|
return {
|
|
|
|
|
restrict: 'A',
|
|
|
|
|
require: '^baSidebarTogglingItem',
|
|
|
|
|
link: function(scope, el, attrs, baSidebarTogglingItem) {
|
|
|
|
|
el.on('click', function() {
|
|
|
|
|
if (baSidebarService.isMenuCollapsed()) {
|
|
|
|
|
// If the whole sidebar is collapsed and this item has submenu. We need to open sidebar.
|
|
|
|
|
// This should not affect mobiles, because on mobiles sidebar should be hidden at all
|
|
|
|
|
scope.$apply(function() {
|
|
|
|
|
baSidebarService.setMenuCollapsed(false);
|
|
|
|
|
});
|
|
|
|
|
baSidebarTogglingItem.$expand();
|
|
|
|
|
} else {
|
|
|
|
|
baSidebarTogglingItem.$toggle();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|