From 8b3fce9656e8d3f190c25739cb7b8d89074cd92a Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Tue, 22 Sep 2020 11:38:32 +0200 Subject: [PATCH] Move it again --- app/assets/javascripts/sitewide/atwho_res.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/sitewide/atwho_res.js b/app/assets/javascripts/sitewide/atwho_res.js index fce6ce104..77c14c34a 100644 --- a/app/assets/javascripts/sitewide/atwho_res.js +++ b/app/assets/javascripts/sitewide/atwho_res.js @@ -35,12 +35,6 @@ var SmartAnnotation = (function() { return $html; } - function initAtWhoClose() { - $('.atwho-view').on('click', '.dismiss', function() { - $('.atwho-view').hide(); - }); - } - // Generates suggestion dropdown filter function generateFilterMenu() { var menu = ''; @@ -205,8 +199,7 @@ var SmartAnnotation = (function() { } return { - init: init, - initAtWhoClose: initAtWhoClose + init: init }; } // Closes the atwho popup * needed in repositories to close the popup @@ -218,7 +211,6 @@ var SmartAnnotation = (function() { function initialize(field) { var atWho = new SetAtWho(field); atWho.init(); - atWho.initAtWhoClose(); } return Object.freeze({ @@ -236,4 +228,8 @@ var SmartAnnotation = (function() { SmartAnnotation.init(this); } }); + + $(document).on('click', '.atwho-view .dismiss', function() { + $(this).closest('.atwho-view').hide(); + }); }());