From a7db17b0b2d1a2ee720c9b923d0db1fc051c5c97 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 11 Mar 2017 17:45:13 -0500 Subject: Move isVisible() method --- assets/js/src/App.js | 20 -------------------- assets/js/src/BoardPolling.js | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) (limited to 'assets/js/src') diff --git a/assets/js/src/App.js b/assets/js/src/App.js index 9aa97061..12889c58 100644 --- a/assets/js/src/App.js +++ b/assets/js/src/App.js @@ -112,23 +112,3 @@ Kanboard.App.prototype.showLoadingIcon = function() { Kanboard.App.prototype.hideLoadingIcon = function() { $("#app-loading-icon").remove(); }; - -Kanboard.App.prototype.isVisible = function() { - var property = ""; - - if (typeof document.hidden !== "undefined") { - property = "visibilityState"; - } else if (typeof document.mozHidden !== "undefined") { - property = "mozVisibilityState"; - } else if (typeof document.msHidden !== "undefined") { - property = "msVisibilityState"; - } else if (typeof document.webkitHidden !== "undefined") { - property = "webkitVisibilityState"; - } - - if (property !== "") { - return document[property] == "visible"; - } - - return true; -}; diff --git a/assets/js/src/BoardPolling.js b/assets/js/src/BoardPolling.js index ba38b779..44ad5379 100644 --- a/assets/js/src/BoardPolling.js +++ b/assets/js/src/BoardPolling.js @@ -13,7 +13,7 @@ Kanboard.BoardPolling.prototype.execute = function() { }; Kanboard.BoardPolling.prototype.check = function() { - if (this.app.isVisible() && !this.app.get("BoardDragAndDrop").savingInProgress) { + if (KB.utils.isVisible() && !this.app.get("BoardDragAndDrop").savingInProgress) { var self = this; this.app.showLoadingIcon(); -- cgit v1.2.3