Commit 182ae559 authored by HERBERT Ryan's avatar HERBERT Ryan

Query indicator

Added indicator when ajax query is in progress
parent b370c688
......@@ -256,6 +256,7 @@
<a class="buttonSelector" onclick="changeStyle('solarizeD')">dark</a>
</div></div>
</div>
<div style="float: right; margin: 5px;" id='live-ajax'></div>
<div id="fps" style="float: right; display: none"> </div>
<div id="header_messages" class="message_container header"></div>
......
......@@ -981,6 +981,19 @@ Database.prototype = {
return args
},
ajax_indicator_start: function() {
var tgt = $('#live-ajax');
tgt.empty();
$('<img/>', {src: 'images/ajax-loader.gif'}).appendTo($('<div/>', {class: 'active-container'}).appendTo(tgt));
$('body').css('cursor', 'wait');
},
ajax_indicator_stop: function() {
var tgt = $('#live-ajax');
tgt.empty();
$('body').css('cursor', 'default');
},
// Log functions, to server
// 'quiet' is set to true to avoid infinite loops with timeouts
log : function (lvl, msg) { this.request('default/logger', {'lvl': lvl, 'msg': msg}, true) },
......
......@@ -97,6 +97,14 @@ try {
console.log("=== main.js finished ===");
$(document).ajaxStart(function () {
//show ajax indicator
db.ajax_indicator_start('loading data.. please wait..');
}).ajaxStop(function () {
//hide ajax indicator
db.ajax_indicator_stop();
});
(function worker(){
db.loadNotifications();
setTimeout(worker, 300000);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment