diff --git a/app/assets/javascripts/sitewide/atwho_users.js.erb b/app/assets/javascripts/sitewide/atwho_users.js.erb index 2e406dca7..91adb1838 100644 --- a/app/assets/javascripts/sitewide/atwho_users.js.erb +++ b/app/assets/javascripts/sitewide/atwho_users.js.erb @@ -5,6 +5,8 @@ 'focus', '[data-atwho-users-edit]', function() { + // Only initialize if URL is present and + // atwho is not initialized yet if ( $(document.body).is('[data-atwho-users-url]') && _.isUndefined($(this).data('atwho')) @@ -54,29 +56,21 @@ return res; }, highlighter: function(li, query) { + function highlight(el, sel, re) { + var prevVal = el.find(sel).html(); + var newVal = prevVal.replace(re, '$&'); + el.find(sel).html(newVal); + } + if (!query) { return li; } - var li2 = $(li); + var $li = $(li); var re = new RegExp(query, 'gi'); - var prevVal = - li2 - .find('[data-val=full-name]') - .html(); - var newVal = - prevVal - .replace(re, '$&'); - li2.find('[data-val=full-name]').html(newVal); - prevVal = - li2 - .find('[data-val=email]') - .html(); - newVal = - prevVal - .replace(re, '$&'); - li2.find('[data-val=email]').html(newVal); - return li2[0].outerHTML; + highlight($li, '[data-val=full-name]', re); + highlight($li, '[data-val=email]', re); + return $li[0].outerHTML; }, beforeInsert: function(value, li) { var res = ''; @@ -101,6 +95,9 @@ '<%= I18n.t("atwho.users.dismiss_1") %> ' + '<%= I18n.t("atwho.users.dismiss_2") %>' + '' + + '
' + + '' + + '
' + '' + '', limit: <%= Constants::ATWHO_SEARCH_LIMIT %>, diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index 4761fb8e8..9e4e8ae6f 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -1787,10 +1787,19 @@ th.custom-field .modal-tooltiptext { display: inline; margin-right: 15px; font-size: smaller; + } - strong { - color: $color-black; - } + div strong { + color: $color-black; + } + + .dismiss { + color: $color-emperor; + } + + .dismiss:hover { + color: $color-black; + cursor: pointer; } } }