From d2c6e1c5e372cba7517b1ecc376c97dc032f003a Mon Sep 17 00:00:00 2001 From: ninadsp Date: Tue, 15 Jun 2010 15:16:32 +0530 Subject: [PATCH] Improved the PMA_ajaxShowMessage() function. Now, multiple messages won't be seen at the same time --- js/functions.js | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/js/functions.js b/js/functions.js index 1d3b74a69..b1635bb1c 100755 --- a/js/functions.js +++ b/js/functions.js @@ -15,6 +15,12 @@ var sql_box_locked = false; */ var only_once_elements = new Array(); +/** + * @var ajax_notification_visible boolean boolean that stores status of + * notification for PMA_ajaxShowNotification + */ +var ajax_message_init = false; + /** * selects the content of a given object, f.e. a textarea * @@ -1735,6 +1741,7 @@ function PMA_ajaxInsertResponse(divisions_map) { */ function PMA_ajaxShowMessage(message, timeout) { + if(!message) { var msg = 'Loading...'; } @@ -1749,16 +1756,28 @@ function PMA_ajaxShowMessage(message, timeout) { var to = timeout; } - $(function(){ - $('') - .insertBefore("#serverinfo") - .text(msg) + if( !ajax_message_init) { + $(function(){ + $('') + .insertBefore("#serverinfo") + .html(msg) + .slideDown('medium') + .delay(to) + .slideUp('medium', function(){ + $(this).html(""); //Clear the message + }); + }, 'top.frame_content'); + ajax_message_init = true; + } + else { + $("#loading") + .html(msg) .slideDown('medium') .delay(to) - .slideUp('medium', function(){ - $(this).remove(); - }); - }, 'top.frame_content') + .slideUp('medium', function() { + $(this).html(""); + }) + } } /**