diff --git a/test/spec/controllers/inventoryCtrlSpec.js b/test/spec/controllers/inventoryCtrlSpec.js index 3b2fd4a96c..1d8d0c95c3 100644 --- a/test/spec/controllers/inventoryCtrlSpec.js +++ b/test/spec/controllers/inventoryCtrlSpec.js @@ -91,7 +91,6 @@ describe('Inventory Controller', function() { })); describe('Deselecting Items', function() { - it('deselects a food', function(){ scope.chooseFood('Meat'); scope.deselectItem(); @@ -109,7 +108,5 @@ describe('Inventory Controller', function() { scope.deselectItem(); expect(scope.selectedEgg).to.eql(null); }); - }); - }); diff --git a/website/public/js/controllers/inventoryCtrl.js b/website/public/js/controllers/inventoryCtrl.js index 5c9a320910..45269be1c5 100644 --- a/website/public/js/controllers/inventoryCtrl.js +++ b/website/public/js/controllers/inventoryCtrl.js @@ -217,18 +217,11 @@ habitrpg.controller("InventoryCtrl", $scope.deselectItem(); } }); - //$scope.listen(keyEvent) $scope.deselectItem = function() { - if ($scope.selectedFood) { - $scope.selectedFood = null; - } - if ($scope.selectedPotion) { - $scope.selectedPotion = null - } - if ($scope.selectedEgg) { - $scope.selectedEgg = null; - } + $scope.selectedFood = null; + $scope.selectedPotion = null; + $scope.selectedEgg = null; } }