Adjust sm modal to not attach objects on rootScope

This commit is contained in:
Blade Barringer
2015-11-17 21:23:20 -06:00
parent b280267cde
commit 5b7c02334a

View File

@@ -116,14 +116,17 @@ habitrpg.controller("InventoryCtrl",
if (!$window.confirm(window.env.t('hatchAPot', {potion: potName, egg: eggName}))) return; if (!$window.confirm(window.env.t('hatchAPot', {potion: potName, egg: eggName}))) return;
user.ops.hatch({params:{egg:egg.key, hatchingPotion:potion.key}}); user.ops.hatch({params:{egg:egg.key, hatchingPotion:potion.key}});
if (!user.preferences.suppressModals.hatchPet) { if (!user.preferences.suppressModals.hatchPet) {
$rootScope.hatchedPet = { $scope.hatchedPet = {
egg: eggName, egg: eggName,
potion: potName, potion: potName,
potionKey:potion.key, potionKey:potion.key,
eggKey: egg.key, eggKey: egg.key,
pet: 'Pet-' + egg.key + '-' + potion.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.selectedEgg = null;
$scope.selectedPotion = null; $scope.selectedPotion = null;
@@ -167,13 +170,16 @@ habitrpg.controller("InventoryCtrl",
_updateDropAnimalCount(user.items); _updateDropAnimalCount(user.items);
if (Stats.totalCount(user.items.mounts) > startingMounts && !user.preferences.suppressModals.raisePet) { if (Stats.totalCount(user.items.mounts) > startingMounts && !user.preferences.suppressModals.raisePet) {
$rootScope.raisedPet = { $scope.raisedPet = {
displayName: petDisplayName, displayName: petDisplayName,
spriteName: pet, spriteName: pet,
egg: egg, egg: egg,
potion: potion 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 // Checks if mountmaster has been reached for the first time