From 1ae5e24077ec75130a30430cf08450d12c667379 Mon Sep 17 00:00:00 2001 From: "PC Dreams (Paulo Cristo)" Date: Tue, 20 Oct 2015 09:41:11 +0100 Subject: [PATCH] avoid neverending spinning wheel ui mask, when operation is stalled --- src/af.ui.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/af.ui.js b/src/af.ui.js index c0e91b400..8c4a01c07 100644 --- a/src/af.ui.js +++ b/src/af.ui.js @@ -116,6 +116,7 @@ AFUi.prototype = { init:false, showLoading: true, + showingMask: false, loadingText: "Loading Content", remotePages: {}, history: [], @@ -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 @@ -612,6 +622,7 @@ */ hideMask: function() { $.query("#afui_mask").hide(); + this.showingMask = false; }, /** * @api private