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

Commit

Permalink
avoid neverending spinning wheel ui mask, when operation is stalled
Browse files Browse the repository at this point in the history
  • Loading branch information
uareurapid committed Oct 20, 2015
1 parent d930b4b commit 1ae5e24
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/af.ui.js
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

0 comments on commit 1ae5e24

Please sign in to comment.