Merge pull request +7599 from c9/fix/collab-code-reverting

Fixed issue with clients in fallback saving reverting code
This commit is contained in:
Lennart Kats 2015-06-11 17:29:37 +02:00
commit 2bbb7fd8cd
2 changed files with 10 additions and 7 deletions

View File

@ -106,7 +106,7 @@
"c9.ide.run": "#469ffef3f1",
"c9.ide.run.build": "#ad45874c88",
"c9.ide.run.debug.xdebug": "#3b1520f83d",
"c9.ide.save": "#a03709ef3f",
"c9.ide.save": "#58b8616a88",
"c9.ide.terminal.monitor": "#b0b4d03280",
"c9.ide.theme.flat": "#b1d65fa9bb",
"c9.ide.threewaymerge": "#229382aa0b",

View File

@ -102,6 +102,9 @@ define(function(require, exports, module) {
save.on("beforeSave", function(e) {
e.document.meta.$savingValue = e.save;
if (e.tab.classList.contains("conflict")) {
showChangeDialog(e.tab);
}
}, plugin);
save.on("afterSave", function(e) {
@ -229,8 +232,12 @@ define(function(require, exports, module) {
if (!tabManager.findTab(path)) // drat! tab is gone
return;
// Show dialog
showChangeDialog();
// Show dialogs for changed tabs
for (var changedPath in changedPaths) {
tab = changedPaths[changedPath].tab;
data = changedPaths[changedPath].data;
showChangeDialog(tab, data);
}
}
function checkByStatOrContents() {
@ -367,9 +374,7 @@ define(function(require, exports, module) {
else {
changedPaths[path].tab.document.undoManager.bookmark(-2);
changedPaths[path].resolve();
showChangeDialog();
}
checkEmptyQueue();
}
@ -382,7 +387,6 @@ define(function(require, exports, module) {
else {
getLatestValue(path, function(err, path, data) {
updateChangedPath(err, path, data);
showChangeDialog();
});
}
@ -408,7 +412,6 @@ define(function(require, exports, module) {
getLatestValue(path, function(err, path, data) {
mergeChangedPath(err, path, data);
showChangeDialog();
});
}