mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Adjust sm modal to not attach objects on rootScope
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user