diff --git a/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js b/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js index e271991fb4..3c427e83e3 100644 --- a/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js +++ b/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js @@ -147,7 +147,8 @@ }, getDocuments: function (callback) { - window.progressView.show("Fetching documents..."); +// window.progressView.show("Fetching documents..."); + window.progressView.showWithDelay(3000, "Fetching documents..."); var self = this, query, bindVars, @@ -201,6 +202,7 @@ data: JSON.stringify(queryObj), contentType: "application/json", success: function(data) { + window.progressView.toShow = false; self.clearDocuments(); if (data.extra && data.extra.fullCount !== undefined) { self.setTotal(data.extra.fullCount); diff --git a/js/apps/system/aardvark/frontend/js/views/progressView.js b/js/apps/system/aardvark/frontend/js/views/progressView.js index 323c001254..9d443439ed 100644 --- a/js/apps/system/aardvark/frontend/js/views/progressView.js +++ b/js/apps/system/aardvark/frontend/js/views/progressView.js @@ -14,6 +14,8 @@ el2: "#progressPlaceholderIcon", + toShow: false, + action: function(){}, events: { @@ -27,6 +29,21 @@ initialize: function() { }, + showWithDelay: function(delay, msg, action, button) { + var self = this; + self.toShow = true; + + setTimeout(function(delay) { + if (self.toShow === true) { + console.log("show with delay"); + self.show(msg, action, button); + } + else { + console.log("dont have to show"); + } + }, delay); + }, + show: function(msg, action, button) { $(this.el).html(this.template.render({})); $(".progress-text").text(msg);