Improved the PMA_ajaxShowMessage() function. Now, multiple messages

won't be seen at the same time
This commit is contained in:
ninadsp
2010-06-15 15:16:32 +05:30
parent 0f081a8437
commit d2c6e1c5e3

View File

@@ -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;
}
if( !ajax_message_init) {
$(function(){
$('<span id="loading" class="ajax_notification"></span>')
.insertBefore("#serverinfo")
.text(msg)
.html(msg)
.slideDown('medium')
.delay(to)
.slideUp('medium', function(){
$(this).remove();
$(this).html(""); //Clear the message
});
}, 'top.frame_content')
}, 'top.frame_content');
ajax_message_init = true;
}
else {
$("#loading")
.html(msg)
.slideDown('medium')
.delay(to)
.slideUp('medium', function() {
$(this).html("");
})
}
}
/**