mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
rewrite2 remove unecessary code
This commit is contained in:
parent
3c11f76998
commit
0cb73505c8
2 changed files with 8 additions and 51 deletions
File diff suppressed because one or more lines are too long
|
|
@ -10,57 +10,15 @@ habitrpg.controller('MenuCtrl',
|
|||
['$scope', '$rootScope', '$location', 'User',
|
||||
function($scope, $rootScope, $location, User) {
|
||||
|
||||
$scope.swiperight = function(){
|
||||
$scope.menuopen = true;
|
||||
}
|
||||
//FIXME where to implement this in rewrite?
|
||||
|
||||
$scope.refreshing = function () {
|
||||
return User.settings.fetching ? "spin" : ""
|
||||
};
|
||||
|
||||
$scope.swipeleft = function(){
|
||||
$scope.menuopen = false;
|
||||
}
|
||||
|
||||
$scope.menuClick = function(button) {
|
||||
$scope.menuopen = false;
|
||||
$location.url(button.link);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show title according to the location
|
||||
*/
|
||||
$rootScope.$on('$routeChangeSuccess', function(){
|
||||
var found = _.find($scope.nav, function(obj){
|
||||
return obj.link === $location.path();
|
||||
});
|
||||
if (found) {
|
||||
$rootScope.taskContext = {
|
||||
name: found.name,
|
||||
type: found.link.substr(1) // remove trailing /
|
||||
};
|
||||
$rootScope.menuopen = false;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.nav = [
|
||||
{ link:'/habit', name:'Habits', lowercase:'habits' },
|
||||
{ link:'/daily', name:'Dailies', lowercase:'dailies' },
|
||||
{ link:'/todo', name:'Todos', lowercase:'todos' },
|
||||
{ link:'/reward', name:'Rewards', lowercase:'rewards' },
|
||||
{ link:'/profile', name:'Profile', lowercase:'profile' },
|
||||
{ link:'/settings', name:'Settings',lowercase:'settings' },
|
||||
{ link:'/help', name:'Help', lowercase:'help' }
|
||||
]
|
||||
|
||||
$scope.refreshing = function () {
|
||||
return User.settings.fetching ? "spin" : ""
|
||||
};
|
||||
|
||||
$scope.queueLength = function () {
|
||||
return User.settings.sync.queue.length || User.settings.sync.sent.length
|
||||
};
|
||||
|
||||
$scope.stats = User.user.stats;
|
||||
|
||||
$('#main_nav').css('height', $(window).height())
|
||||
$('#wrapper').css('height', $(window).height())
|
||||
$scope.queueLength = function () {
|
||||
return User.settings.sync.queue.length || User.settings.sync.sent.length
|
||||
};
|
||||
|
||||
}
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue