From 5941b6e3a6fafdc2d6fbb6dd33b994c7aaa10865 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 24 Sep 2014 14:03:15 +0100 Subject: [PATCH] Fixed auto-refresh interrupting sorting. Closes #306. --- resources/report/js/script.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 222c8cdc..e8732d13 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -25,7 +25,7 @@ var marked; var l10n; var loot = { - hasFocus: true, + pauseAutoRefresh: false, installedGames: [], settings: {}, game: { @@ -795,6 +795,7 @@ function closeProgressDialog() { } } function sortPlugins(evt) { + loot.pauseAutoRefresh = true; var mlistUpdate; if (loot.settings.updateMasterlist) { mlistUpdate = updateMasterlist(evt); @@ -869,6 +870,9 @@ function applySort(evt) { showElement(document.getElementById('sortButton')); hideElement(document.getElementById('applySortButton')); hideElement(document.getElementById('cancelSortButton')); + + /* Re-enable auto-refresh. */ + loot.pauseAutoRefresh = false; }).catch(processCefError); } function cancelSort(evt) { @@ -884,6 +888,9 @@ function cancelSort(evt) { showElement(document.getElementById('sortButton')); hideElement(document.getElementById('applySortButton')); hideElement(document.getElementById('cancelSortButton')); + + /* Re-enable auto-refresh. */ + loot.pauseAutoRefresh = false; }).catch(processCefError); } function redatePlugins(evt) { @@ -1370,6 +1377,9 @@ function initVars() { }).catch(processCefError); } function onFocus(evt) { + if (loot.pauseAutoRefresh) { + return; + } /* Send a query for updated load order and plugin header info. */ updateProgressDialog('Refreshing data...'); openProgressDialog();