diff --git a/src/sql/parts/notebook/notebook.component.ts b/src/sql/parts/notebook/notebook.component.ts index 44890a16d1..61b02bb03f 100644 --- a/src/sql/parts/notebook/notebook.component.ts +++ b/src/sql/parts/notebook/notebook.component.ts @@ -321,6 +321,9 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe public async save(): Promise { try { let saved = await this._model.saveModel(); + if (saved) { + this.setDirty(false); + } return saved; } catch (err) { this.notificationService.error(localize('saveFailed', 'Failed to save notebook: {0}', notebookUtils.getErrorMessage(err))); @@ -329,10 +332,9 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe } private setDirty(isDirty: boolean): void { - // TODO reenable handling of isDirty - // if (this.editor) { - // this.editor.isDirty = isDirty; - // } + if(this._notebookParams.input){ + this._notebookParams.input.setDirty(isDirty); + } } private actionItemProvider(action: Action): IActionItem { diff --git a/src/sql/parts/notebook/notebookInput.ts b/src/sql/parts/notebook/notebookInput.ts index ec5b3f82c3..991ec861ed 100644 --- a/src/sql/parts/notebook/notebookInput.ts +++ b/src/sql/parts/notebook/notebookInput.ts @@ -169,4 +169,12 @@ export class NotebookInput extends EditorInput { save(): TPromise { return this._model.save(); } + + /** + * Sets active editor with dirty value. + * @param isDirty boolean value to set editor dirty + */ + setDirty(isDirty: boolean): void { + this._model.setDirty(isDirty); + } } \ No newline at end of file