diff --git a/app/assets/javascripts/sitewide/atwho_res.js.erb b/app/assets/javascripts/sitewide/atwho_res.js.erb index 18aa86d96..5dbcf5faa 100644 --- a/app/assets/javascripts/sitewide/atwho_res.js.erb +++ b/app/assets/javascripts/sitewide/atwho_res.js.erb @@ -141,15 +141,21 @@ var SmartAnnotation = (function() { }); } + // initialise dropdown dismiss button + function initDismissButton() { + $('.atwho-header-res .dismiss').off('click'); + $('.atwho-header-res .dismiss').on('click', function() { + $(field).atwho('destroy'); + init(); + }); + } + // Initialize filter buttons function initButtons(query, search_filter) { $('.atwho-header-res query_obj button').off(); $('.atwho-header-res .dismiss').off('click'); - $('.atwho-header-res .dismiss').on('click', function() { - $(field).atwho('destroy'); - init(); - }); + initDismissButton(); resourcesChecker(query, search_filter); $('.atwho-header-res .title button').on('click', function(e) { @@ -290,7 +296,7 @@ var SmartAnnotation = (function() { res += map.name; res += ''; if(map.archived) { - res += '(archived)'; + res += '<%= I18n.t("atwho.res.archived") %>'; } else { res += ''; } @@ -308,8 +314,6 @@ var SmartAnnotation = (function() { case 'sam': res += '' + map.description + ''; break; - default: - break; } res += ''; @@ -327,6 +331,7 @@ var SmartAnnotation = (function() { {query: query}, function(data) { callback(data.users); + initDismissButton(); } ); }, @@ -385,7 +390,7 @@ var SmartAnnotation = (function() { }, headerTpl: '
<%= auto_link(simple_format(comment.message), - link: :urls, - html: { target: '_blank' }) %>
+<%= auto_link( + simple_format( + smart_annotation_parser(comment.message) + ), + link: :urls, + html: { target: '_blank' } + ) %>