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) {
|
getDocuments: function (callback) {
|
||||||
window.progressView.show("Fetching documents...");
|
// window.progressView.show("Fetching documents...");
|
||||||
|
window.progressView.showWithDelay(3000, "Fetching documents...");
|
||||||
var self = this,
|
var self = this,
|
||||||
query,
|
query,
|
||||||
bindVars,
|
bindVars,
|
||||||
|
@ -201,6 +202,7 @@
|
||||||
data: JSON.stringify(queryObj),
|
data: JSON.stringify(queryObj),
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
window.progressView.toShow = false;
|
||||||
self.clearDocuments();
|
self.clearDocuments();
|
||||||
if (data.extra && data.extra.fullCount !== undefined) {
|
if (data.extra && data.extra.fullCount !== undefined) {
|
||||||
self.setTotal(data.extra.fullCount);
|
self.setTotal(data.extra.fullCount);
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
el2: "#progressPlaceholderIcon",
|
el2: "#progressPlaceholderIcon",
|
||||||
|
|
||||||
|
toShow: false,
|
||||||
|
|
||||||
action: function(){},
|
action: function(){},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
|
@ -27,6 +29,21 @@
|
||||||
initialize: function() {
|
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) {
|
show: function(msg, action, button) {
|
||||||
$(this.el).html(this.template.render({}));
|
$(this.el).html(this.template.render({}));
|
||||||
$(".progress-text").text(msg);
|
$(".progress-text").text(msg);
|
||||||
|
|
Loading…
Reference in New Issue