diff --git a/website/public/js/controllers/notificationCtrl.js b/website/public/js/controllers/notificationCtrl.js index 6c30b511c2..cd211e8493 100644 --- a/website/public/js/controllers/notificationCtrl.js +++ b/website/public/js/controllers/notificationCtrl.js @@ -73,15 +73,15 @@ habitrpg.controller('NotificationCtrl', if(after.type === 'HatchingPotion'){ var text = Content.hatchingPotions[after.key].text(); var notes = Content.hatchingPotions[after.key].notes(); - Notification.drop(env.t('messageDropPotion', {dropText: text, dropNotes: notes})); + Notification.drop(env.t('messageDropPotion', {dropText: text, dropNotes: notes}), after); }else if(after.type === 'Egg'){ var text = Content.eggs[after.key].text(); var notes = Content.eggs[after.key].notes(); - Notification.drop(env.t('messageDropEgg', {dropText: text, dropNotes: notes})); + Notification.drop(env.t('messageDropEgg', {dropText: text, dropNotes: notes}), after); }else if(after.type === 'Food'){ var text = Content.food[after.key].text(); var notes = Content.food[after.key].notes(); - Notification.drop(env.t('messageDropFood', {dropArticle: after.article, dropText: text, dropNotes: notes})); + Notification.drop(env.t('messageDropFood', {dropArticle: after.article, dropText: text, dropNotes: notes}), after); }else{ // Keep support for another type of drops that might be added Notification.drop(User.user._tmp.drop.dialog); diff --git a/website/public/js/services/notificationServices.js b/website/public/js/services/notificationServices.js index 9b4ccb8182..a4cd2c0429 100644 --- a/website/public/js/services/notificationServices.js +++ b/website/public/js/services/notificationServices.js @@ -77,8 +77,24 @@ angular.module("habitrpg").factory("Notification", streak: function(val) { notify(window.env.t('streakName') + ': ' + val, 'streak', 'glyphicon glyphicon-repeat'); }, - drop: function(val) { - notify(val, 'drop', 'glyphicon glyphicon-gift'); + drop: function(val, item) { + if ( item !== undefined ) { + var dropClass = ""; + switch ( item.type ) { + case "Egg": + dropClass = 'Pet_Egg_' + item.key; + break; + case "HatchingPotion": + dropClass = 'Pet_Hatching' + item.key; + break; + case "Food": + dropClass = 'Pet_Food_' + item.key; + break; + default: + dropClass = 'glyphicon glyphicon-gift'; + } + } + notify(val, 'drop', dropClass); } }; }]);