1
0
Fork 0

added delay for progress view

This commit is contained in:
Heiko Kernbach 2014-11-06 17:35:17 +01:00
parent c6f8e6c201
commit afbec2aa2b
2 changed files with 20 additions and 1 deletions

View File

@ -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);

View File

@ -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);