mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
- Editor layout gets called sometimes when other events happen (and Notebook isn't visible) - Add in a layout call on re-setting input so the cell is updated. This fixes the problem by laying out once the UI is visible again. Note: long term, should really be destroying the UI (while preserving the model), then restoring it including scroll selection etc. and hooking back up to the model. That is... much more work, but something we'll need long term to avoid issues where we have many Notebooks open at once. Not in scope for this PR
This commit is contained in:
@@ -104,13 +104,12 @@ export class NotebookInputModel extends EditorModel {
|
||||
|
||||
|
||||
export class NotebookInput extends EditorInput {
|
||||
|
||||
public static ID: string = 'workbench.editorinputs.notebookInput';
|
||||
|
||||
public hasBootstrapped = false;
|
||||
// Holds the HTML content for the editor when the editor discards this input and loads another
|
||||
private _parentContainer: HTMLElement;
|
||||
|
||||
private readonly _layoutChanged: Emitter<void> = this._register(new Emitter<void>());
|
||||
constructor(private _title: string,
|
||||
private _model: NotebookInputModel,
|
||||
@INotebookService private notebookService: INotebookService,
|
||||
@@ -140,6 +139,14 @@ export class NotebookInput extends EditorInput {
|
||||
return this._model.defaultKernel;
|
||||
}
|
||||
|
||||
get layoutChanged(): Event<void> {
|
||||
return this._layoutChanged.event;
|
||||
}
|
||||
|
||||
doChangeLayout(): any {
|
||||
this._layoutChanged.fire();
|
||||
}
|
||||
|
||||
public getTypeId(): string {
|
||||
return NotebookInput.ID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user