mirror of https://gitee.com/bigwinds/arangodb
added delay for progress view
This commit is contained in:
parent
c6f8e6c201
commit
afbec2aa2b
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue