Prevent replacing the main area widget

pull/6294/head
Jeremy Tuloup 5 years ago
parent a3dffc430c
commit 1cd6be4474

@ -101,9 +101,10 @@ export class ClassicShell extends Widget implements JupyterFrontEnd.IShell {
if (area === 'menu') {
return this._menuHandler.addWidget(widget, rank);
}
this._main.widgets.forEach(w => {
w.close();
});
if (this._main.widgets.length > 0) {
// do not add the widget if there is already one
return;
}
this._main.addWidget(widget);
this._main.update();
this._currentChanged.emit(void 0);

Loading…
Cancel
Save