Commit caf19fd5 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

BaseView: prevent opening multiple disconnection warnings

parent ac2fe30c
......@@ -468,6 +468,20 @@ define([
return this.dynamicURL("/fs/getfile?_workspaceId="+this.workspaceId+"&path="+path);
},
_warnDisconnect: function() {
this._warnDisconnectDialog = this._warnDisconnectDialog || this.confirm(
"This tab's workspace has been disconnected. It will not work properly anymore.",
function (ok) {
this._warnDisconnectDialog = undefined;
if (ok) this.close();
}.bind(this), {
title: "Workspace disconnected",
yesLabel: "Close",
noLabel: "Keep open",
}
);
},
}),$.extend({},
{
init: function() {
......
......@@ -115,14 +115,7 @@ define([
this.on("disconnected", function() {
this._setState("disconnected");
this._instances.map(function (inst) {
inst.confirm("This tabs workspace has been disconnected." +
" It will not work properly anymore.", function (ok) {
if (ok) inst.close();
}, {
title: "Workspace disconnected",
yesLabel: "Close",
noLabel: "Keep open",
});
inst._warnDisconnect();
});
this._finishDisconnect(null);
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment