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

Commit 72a7f44

Browse files
author
Ian Maffett
committed
Merge pull request #897 from uareurapid/master
avoid neverending spinning wheel ui mask, when operation is stalled
2 parents d930b4b + 1ae5e24 commit 72a7f44

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/af.ui.js

+11
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
AFUi.prototype = {
117117
init:false,
118118
showLoading: true,
119+
showingMask: false,
119120
loadingText: "Loading Content",
120121
remotePages: {},
121122
history: [],
@@ -602,6 +603,15 @@
602603
if (!text) text = this.loadingText || "";
603604
$.query("#afui_mask>h1").html(text);
604605
$.query("#afui_mask").show();
606+
this.showingMask = true;
607+
608+
var self = this;
609+
//set another timeout to auto-hide the mask if something goes wrong after 15 secs
610+
setTimeout(function() {
611+
if(self.showingMask) {
612+
self.hideMask();
613+
}
614+
}, 15000);
605615
},
606616
/**
607617
* Hide the loading mask
@@ -612,6 +622,7 @@
612622
*/
613623
hideMask: function() {
614624
$.query("#afui_mask").hide();
625+
this.showingMask = false;
615626
},
616627
/**
617628
* @api private

0 commit comments

Comments
 (0)