diff --git a/website/public/js/controllers/rootCtrl.js b/website/public/js/controllers/rootCtrl.js index a8eb87641d..53e802a0b7 100644 --- a/website/public/js/controllers/rootCtrl.js +++ b/website/public/js/controllers/rootCtrl.js @@ -3,8 +3,8 @@ /* Make user and settings available for everyone through root scope. */ -habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$http', '$state', '$stateParams', 'Notification', 'Groups', 'Shared', 'Content', '$modal', '$timeout', 'ApiUrl', 'Payments','$sce','$window', '$filter', - function($scope, $rootScope, $location, User, $http, $state, $stateParams, Notification, Groups, Shared, Content, $modal, $timeout, ApiUrl, Payments, $sce, $window, $filter) { +habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$http', '$state', '$stateParams', 'Notification', 'Groups', 'Shared', 'Content', '$modal', '$timeout', 'ApiUrl', 'Payments','$sce','$window', + function($scope, $rootScope, $location, User, $http, $state, $stateParams, Notification, Groups, Shared, Content, $modal, $timeout, ApiUrl, Payments, $sce, $window) { var user = User.user; var initSticky = _.once(function(){ @@ -278,7 +278,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$ case 'user': msg = window.env.t('youCastTarget', {spell: spell.text(), target: target.profile.name});break; case 'party': msg = window.env.t('youCastParty', {spell: spell.text()});break; } - Notification.text($filter("markdown")(msg)); + Notification.markdown(msg); User.sync(); }); } diff --git a/website/public/js/services/notificationServices.js b/website/public/js/services/notificationServices.js index 481f3222e0..f6f586293c 100644 --- a/website/public/js/services/notificationServices.js +++ b/website/public/js/services/notificationServices.js @@ -2,7 +2,7 @@ Set up "+1 Exp", "Level Up", etc notifications */ angular.module("habitrpg").factory("Notification", -[function() { +['$filter', function($filter) { var stack_topright = {"dir1": "down", "dir2": "left", "spacing1": 15, "spacing2": 15, "firstpos1": 60}; function notify(html, type, icon) { var notice = $.pnotify({ @@ -62,6 +62,12 @@ angular.module("habitrpg").factory("Notification", notify(val, 'info'); } }, + markdown: function(val){ + if (val) { + var parsed_markdown = $filter("markdown")(val); + notify(parsed_markdown, 'info'); + } + }, lvl: function(){ notify(window.env.t('levelUp'), 'lvl', 'glyphicon glyphicon-chevron-up'); },