diff --git a/website/public/js/controllers/inventoryCtrl.js b/website/public/js/controllers/inventoryCtrl.js index aa324f6d9b..76a59e4f4a 100644 --- a/website/public/js/controllers/inventoryCtrl.js +++ b/website/public/js/controllers/inventoryCtrl.js @@ -116,14 +116,17 @@ habitrpg.controller("InventoryCtrl", if (!$window.confirm(window.env.t('hatchAPot', {potion: potName, egg: eggName}))) return; user.ops.hatch({params:{egg:egg.key, hatchingPotion:potion.key}}); if (!user.preferences.suppressModals.hatchPet) { - $rootScope.hatchedPet = { + $scope.hatchedPet = { egg: eggName, potion: potName, potionKey:potion.key, eggKey: egg.key, pet: 'Pet-' + egg.key + '-' + potion.key }; - $rootScope.openModal('hatchPet', {controller: 'InventoryCtrl', size: 'sm'}); + $rootScope.openModal('hatchPet', { + scope: $scope, + size: 'sm' + }); } $scope.selectedEgg = null; $scope.selectedPotion = null; @@ -167,13 +170,16 @@ habitrpg.controller("InventoryCtrl", _updateDropAnimalCount(user.items); if (Stats.totalCount(user.items.mounts) > startingMounts && !user.preferences.suppressModals.raisePet) { - $rootScope.raisedPet = { + $scope.raisedPet = { displayName: petDisplayName, spriteName: pet, egg: egg, potion: potion } - $rootScope.openModal('raisePet', {controller:'InventoryCtrl',size:'sm'}); + $rootScope.openModal('raisePet', { + scope: $scope, + size:'sm' + }); } // Checks if mountmaster has been reached for the first time