Fixes c9/core+110 always use close() when unloading tabs

pull/223/head
Ruben Daniels 2015-10-28 15:03:15 -07:00 zatwierdzone przez nightwing
rodzic f52d889cbf
commit a52b93b35d
2 zmienionych plików z 12 dodań i 7 usunięć

Wyświetl plik

@ -289,6 +289,15 @@ define(function(require, module, exports) {
load();
});
plugin.on("beforeUnload", function(){
if (!plugin.meta.$closing) {
plugin.document.meta.$ignoreSave = true;
close();
delete plugin.document.meta.$ignoreSave;
return false;
}
});
plugin.on("unload", function(e) {
closed = true;

Wyświetl plik

@ -132,11 +132,8 @@ define(function(require, module, exports) {
function removeTab(e) {
if (!e.error) {
var tab = findTab(e.path);
if (tab) {
tab.document.meta.$ignoreSave = true;
tab.close();
delete tab.document.meta.$ignoreSave;
}
if (tab)
tab.unload();
}
}
fs.on("afterUnlink", removeTab);
@ -145,9 +142,8 @@ define(function(require, module, exports) {
var path = e.path;
Object.keys(tabs).forEach(function(id) {
var tab = tabs[id];
if (tab.path && tab.path.indexOf(path) === 0) {
if (tab.path && tab.path.indexOf(path) === 0)
tab.unload();
}
});
});
// Close a pane when it doesn't open