Files
habitica/assets/js/controllers/menuCtrl.js
T
Tyler Renelle 7bfaac80a7 rewrite2 big one: add ngRoute for /#/tasks & /#/options. requires 2
/partial routes on server. code cleanup & reorganization, remove a lot
of return statements (coffeescript compiled)
2013-08-27 21:13:05 -04:00

25 lines
621 B
JavaScript

'use strict';
/**
* The menu controller:
* - sets the menu options, should we do it dynamic so it generates the menu like: width = 1/elements * 100 ?
* - exposes the model to the template and provides event handlers
*/
habitrpg.controller('MenuCtrl',
['$scope', '$rootScope', '$location', 'User',
function($scope, $rootScope, $location, User) {
//FIXME where to implement this in rewrite?
$scope.refreshing = function () {
User.settings.fetching ? "spin" : ""
};
$scope.queueLength = function () {
User.settings.sync.queue.length || User.settings.sync.sent.length
};
}
]);