MOBILE_APP on static, deep-watch user.items.gear.equipped

This commit is contained in:
Tyler Renelle 2013-12-15 23:17:09 -07:00
parent 07a27d1c22
commit 616cf41017
2 changed files with 4 additions and 3 deletions

View file

@ -3,6 +3,7 @@
habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','Notification', '$http', 'API_URL',
function($scope, $rootScope, $location, User, Notification, $http, API_URL) {
$scope.obj = User.user; // used for task-lists
$scope.user = User.user;
$scope.score = function(task, direction) {
User.user.ops.score({params:{id: task.id, direction:direction}})
@ -78,11 +79,10 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
$scope.$watch('user.items.gear.equipped', function(){
$scope.itemStore = $rootScope.Shared.updateStore(User.user);
})
},true);
$scope.buy = function(item) {
User.user.ops.buy({params:{key:item.key}});
$scope.itemStore = $rootScope.Shared.updateStore(User.user);
};

View file

@ -3,4 +3,5 @@
window.habitrpg = angular.module('habitrpg', ['notificationServices', 'userServices', 'chieffancypants.loadingBar'])
.constant("API_URL", "")
.constant("STORAGE_USER_ID", 'habitrpg-user')
.constant("STORAGE_SETTINGS_ID", 'habit-mobile-settings')
.constant("STORAGE_SETTINGS_ID", 'habit-mobile-settings')
.constant("MOBILE_APP", false)