From 425a2563f9d63bb322e19b1290cc8a7e8203efef Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 16 Feb 2019 13:48:31 -0700 Subject: [PATCH] Update template.php Adjusted JS for message bar display to better support being called by JS directly. --- themes/default/template.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/themes/default/template.php b/themes/default/template.php index 72157d22dd..e7f1ede464 100644 --- a/themes/default/template.php +++ b/themes/default/template.php @@ -76,13 +76,16 @@ message_text.click(function() { var object = $(this); object.clearQueue().finish(); - $("#message_container").css({'display':'none'}); + $("#message_container div").remove(); + $("#message_container").css({opacity: 0, 'height': 0}).css({'height': 'auto'}); } ); $("#message_container").append(message_text); - message_text.animate({opacity: 1}, 250, function(){ - $("#message_container").delay(delay).animate({opacity: 0, height: '0'}, 1000); + message_text.css({'height': 'auto'}).animate({opacity: 1}, 250, function(){ + $("#message_container").delay(delay).animate({opacity: 0, 'height': 0}, 500, function() { + $("#message_container div").remove(); + $("#message_container").animate({opacity: 1}, 300).css({'height': 'auto'}); + }); }); - } } @@ -91,7 +94,10 @@ //hide message bar on hover - $(".message_text").mouseover(function() { $("#message_container").css({display:'none'}); }); + $("#message_container").mouseover(function() { + $("#message_container div").remove(); + $("#message_container").css({opacity: 0, 'height': 0}).css({'height': 'auto'}); + }); 1) {