Skip to content

Commit

Permalink
fix expand/collapse menu
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaDanovsky committed Nov 13, 2015
1 parent 5f15d5d commit 6c52ba2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/components/pageTop/pageTop.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="page-top clearfix">
<a href="#/dashboard" class="al-logo clearfix"><span>Blur</span>Admin</a>
<a href class="collapse-menu-link ion-navicon" ng-click="menuToggle()"></a>
<a href class="collapse-menu-link ion-navicon" ng-click="isMenuCollapsed=!isMenuCollapsed"></a>

<div class="search">
<i class="ion-ios-search-strong" ng-click="startSearch()"></i>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/sidebar/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ a.al-sidebar-list-link {

@mixin layout-collapsed() {
.al-main {
margin-left: 70px;
margin-left: 50px;
}

.al-footer {
Expand Down Expand Up @@ -140,7 +140,7 @@ a.al-sidebar-list-link {
left: 176px;
height: 42px;
display: none;
transition: all 0.3s ease;
transition: all 0.5s ease;
&.show-hover-elem {
height: 42px;
display: block;
Expand Down
8 changes: 3 additions & 5 deletions src/app/components/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,11 @@ blurAdminApp.directive('sidebar', function () {
$scope.isMenuCollapsed = true;
};

$scope.menuToggle = function () {
$scope.isMenuCollapsed = !$scope.isMenuCollapsed;

if (!$scope.isMenuCollapsed && !$scope.selectElemTop) {
$scope.$watch('isMenuCollapsed', function(newValue) {
if (!newValue && !$scope.selectElemTop) {
changeSelectElemTopValue();
}
};
})

// watch window resize to change menu collapsed state if needed
$(window).resize(function () {
Expand Down

0 comments on commit 6c52ba2

Please sign in to comment.