Skip to content

Commit

Permalink
Optimize the click sensitivity of dashboard's sidebar menu (alibaba#268)
Browse files Browse the repository at this point in the history
- Use AngularJS binding model directly rather than jQuery DOM-based operation
  • Loading branch information
cdfive authored and sczyh30 committed Nov 29, 2018
1 parent 4f854c9 commit 0bc07f3
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ angular.module('sentinelDashboardApp')

// toggle side bar
$scope.click = function ($event) {
let element = angular.element($event.target);
let entry = angular.element($event.target).scope().entry;
entry.active = !entry.active;
entry.active = !entry.active;// toggle this clicked app bar

if (entry.active === false) {
element.parent().children('ul').hide();
} else {
element.parent().parent().children('li').children('ul').hide();
element.parent().children('ul').show();
}
$scope.apps.forEach(function (item) {// collapse other app bars
if (item != entry) {
item.active = false;
}
});
};

/**
Expand Down

0 comments on commit 0bc07f3

Please sign in to comment.