From e04e89178aa0c526941ab014dab54ede11f3d3a7 Mon Sep 17 00:00:00 2001 From: Tim Robinson Date: Tue, 13 Sep 2016 10:28:32 +0000 Subject: [PATCH] Renaming functions to be clearer --- plugins/c9.ide.watcher/gui.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/c9.ide.watcher/gui.js b/plugins/c9.ide.watcher/gui.js index 0204c480..69fe7dac 100644 --- a/plugins/c9.ide.watcher/gui.js +++ b/plugins/c9.ide.watcher/gui.js @@ -178,7 +178,7 @@ define(function(require, exports, module) { function isTabSaving(tab) { - return tab.document.meta.$saving; + return !!tab.document.meta.$saving; } function addChangedTab(tab, doubleCheckComparisonType) { @@ -231,9 +231,10 @@ define(function(require, exports, module) { if (tabManager.focussedTab && !changedPaths[tabManager.focussedTab.path]) { doc.tab.classList.add("conflict"); // Let's try again later, maybe then one of our paths gets focus - return tabManager.once("focus", function() { + tabManager.once("focus", function() { showChangeDialog(tab, data); }); + return; } if (!tabManager.findTab(path)) // drat! tab is gone @@ -402,7 +403,7 @@ define(function(require, exports, module) { changedPaths[path].tab.document.undoManager.bookmark(-2); changedPaths[path].resolve(); } - checkEmptyQueue(); + checkIfQueueIsEmpty(); } function yes(all) { // Remote | Yes @@ -415,7 +416,7 @@ define(function(require, exports, module) { getLatestValue(path, updateChangedPath); } - checkEmptyQueue(); + checkIfQueueIsEmpty(); } if (merge) { @@ -438,7 +439,7 @@ define(function(require, exports, module) { getLatestValue(path, mergeChangedPath); } - checkEmptyQueue(); + checkIfQueueIsEmpty(); }, { merge: true, @@ -544,7 +545,7 @@ define(function(require, exports, module) { showDeleteDialog(); } - checkEmptyQueue(); + checkIfQueueIsEmpty(); }, function(all, cancel) { // No if (all) { @@ -559,7 +560,7 @@ define(function(require, exports, module) { showDeleteDialog(); } - checkEmptyQueue(); + checkIfQueueIsEmpty(); }, { all: Object.keys(removedPaths).length > 1 } ); @@ -576,7 +577,9 @@ define(function(require, exports, module) { tabManager.focusTab(tab); } - function checkEmptyQueue(){ + function checkIfQueueIsEmpty(){ + showChangeDialog(); + for (var prop in changedPaths) return; for (var prop in removedPaths) return;