This is an automated email from the ASF dual-hosted git repository. gcruz pushed a commit to branch gc/8537 in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/gc/8537 by this push: new f6c0fe853 fixup! fixup! fixup! [#8537] moved g analytics further down the page f6c0fe853 is described below commit f6c0fe85305c5cb10c71e40a19685d0135ad8e54 Author: Guillermo Cruz <guillermo.c...@slashdotmedia.com> AuthorDate: Thu Mar 7 08:30:07 2024 -0700 fixup! fixup! fixup! [#8537] moved g analytics further down the page --- Allura/allura/public/nf/js/jquery.notify.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Allura/allura/public/nf/js/jquery.notify.js b/Allura/allura/public/nf/js/jquery.notify.js index 6e2b938d0..59297c56f 100644 --- a/Allura/allura/public/nf/js/jquery.notify.js +++ b/Allura/allura/public/nf/js/jquery.notify.js @@ -96,6 +96,17 @@ return str.replace(/</g, '<').replace(/>/g, '>'); } + function displayNotification(o){ + var selector = '.' + o.newClass + '.' + o.messageClass; + $(selector).fadeIn(500); + if (!$(selector).hasClass(o.persistentClass)) { + var timer = $(selector).attr('data-timer') || o.timer; + setTimeout(function() { + closer($(selector), o); + }, timer); + } + } + $.fn.notifier = function(options){ var opts = $.extend({}, $.fn.notify.defaults, options); return $(this).each(function() { @@ -106,18 +117,13 @@ $(self).css(o.scrollcss); }); } + $('.' + o.messageClass, self).addClass(o.newClass); var selector = '.' + o.newClass + '.' + o.messageClass; $('body').on("click", selector, function(e) { closer(this, o); }); - $(selector).fadeIn(500); - if (!$(selector).hasClass(o.persistentClass)) { - var timer = $(selector).attr('data-timer') || o.timer; - setTimeout(function() { - closer($(selector), o); - }, timer); - } + displayNotification(o); }); }; @@ -146,6 +152,7 @@ } var html = tmpl(o.tmpl, o); $(this).append(html); + displayNotification(o); } else { if (window.console) { //#JSCOVERAGE_IF window.console