menu update: fixed position, other changes

This commit is contained in:
tmshv committed 2015-08-15 15:39:04 +03:00
1 parent 916c11c516
commit b48b120405
5 files changed
+70 -81

No files matched your search

+6 -18
View File
@@ -21,26 +21,14 @@ module.exports = function (app) {
var menu = new Menu();
$rootScope.$on('$routeChangeSuccess', function (event, current) {
var path = current['$$route'].originalPath;
menu.activate(path);
try{
var path = current['$$route'].originalPath;
menu.activate(path);
}catch(e){
}
});
return menu;
});
app.controller("MenuController", function ($scope, menu) {
$scope.menu = menu;
$scope.isActive = function (item) {
if(menu.current) {
return item.url == menu.current.url;
}else{
return false;
}
};
$scope.isValid = function (item) {
return 'url' in item;
};
});
};