mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Removed if statements and fixed style issues
This commit is contained in:
@@ -91,7 +91,6 @@ describe('Inventory Controller', function() {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
describe('Deselecting Items', function() {
|
describe('Deselecting Items', function() {
|
||||||
|
|
||||||
it('deselects a food', function(){
|
it('deselects a food', function(){
|
||||||
scope.chooseFood('Meat');
|
scope.chooseFood('Meat');
|
||||||
scope.deselectItem();
|
scope.deselectItem();
|
||||||
@@ -109,7 +108,5 @@ describe('Inventory Controller', function() {
|
|||||||
scope.deselectItem();
|
scope.deselectItem();
|
||||||
expect(scope.selectedEgg).to.eql(null);
|
expect(scope.selectedEgg).to.eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -217,18 +217,11 @@ habitrpg.controller("InventoryCtrl",
|
|||||||
$scope.deselectItem();
|
$scope.deselectItem();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//$scope.listen(keyEvent)
|
|
||||||
|
|
||||||
$scope.deselectItem = function() {
|
$scope.deselectItem = function() {
|
||||||
if ($scope.selectedFood) {
|
$scope.selectedFood = null;
|
||||||
$scope.selectedFood = null;
|
$scope.selectedPotion = null;
|
||||||
}
|
$scope.selectedEgg = null;
|
||||||
if ($scope.selectedPotion) {
|
|
||||||
$scope.selectedPotion = null
|
|
||||||
}
|
|
||||||
if ($scope.selectedEgg) {
|
|
||||||
$scope.selectedEgg = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user