瀏覽代碼

Optimize the click sensitivity of dashboard's sidebar menu (#268)

- Use AngularJS binding model directly rather than jQuery DOM-based operation
master
cdfive Eric Zhao 6 年之前
父節點
當前提交
0bc07f314e
共有 1 個檔案被更改,包括 6 行新增8 行删除
  1. +6
    -8
      sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/sidebar/sidebar.js

+ 6
- 8
sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/sidebar/sidebar.js 查看文件

@@ -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;
}
});
};

/**


Loading…
取消
儲存