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;
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user