Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

avoid neverending spinning wheel ui mask, when operation is stalled #897

Merged
merged 1 commit into from
Oct 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/af.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
AFUi.prototype = {
init:false,
showLoading: true,
showingMask: false,
loadingText: "Loading Content",
remotePages: {},
history: [],
Expand Down Expand Up @@ -602,6 +603,15 @@
if (!text) text = this.loadingText || "";
$.query("#afui_mask>h1").html(text);
$.query("#afui_mask").show();
this.showingMask = true;

var self = this;
//set another timeout to auto-hide the mask if something goes wrong after 15 secs
setTimeout(function() {
if(self.showingMask) {
self.hideMask();
}
}, 15000);
},
/**
* Hide the loading mask
Expand All @@ -612,6 +622,7 @@
*/
hideMask: function() {
$.query("#afui_mask").hide();
this.showingMask = false;
},
/**
* @api private
Expand Down