#2012 preventDefault as well as stopPropagation. This will preven the

checkbox from getting checked, which may not be desirable, but at least
 prevents the bug for now
This commit is contained in:
Tyler Renelle
2013-12-20 19:57:03 -07:00
parent f4fca98bd1
commit 58195d9eeb

View File

@@ -163,6 +163,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
} }
$scope.castEnd = function(target, type, $event){ $scope.castEnd = function(target, type, $event){
$event && ($event.stopPropagation(),$event.preventDefault());
if ($scope.spell.target != type) return Notification.text("Invalid target"); if ($scope.spell.target != type) return Notification.text("Invalid target");
$scope.spell.cast(User.user, target); $scope.spell.cast(User.user, target);
$http.post('/api/v2/user/class/cast/' + $scope.spell.name, {target:target, type:type}).success(function(){ $http.post('/api/v2/user/class/cast/' + $scope.spell.name, {target:target, type:type}).success(function(){
@@ -176,7 +177,6 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
$scope.spell = null; $scope.spell = null;
}); });
$rootScope.applyingAction = false; $rootScope.applyingAction = false;
$event && $event.stopPropagation();
} }
// $rootScope.castCancel = function(){ // $rootScope.castCancel = function(){