mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
@@ -321,6 +321,9 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
|||||||
public async save(): Promise<boolean> {
|
public async save(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
let saved = await this._model.saveModel();
|
let saved = await this._model.saveModel();
|
||||||
|
if (saved) {
|
||||||
|
this.setDirty(false);
|
||||||
|
}
|
||||||
return saved;
|
return saved;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.notificationService.error(localize('saveFailed', 'Failed to save notebook: {0}', notebookUtils.getErrorMessage(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 {
|
private setDirty(isDirty: boolean): void {
|
||||||
// TODO reenable handling of isDirty
|
if(this._notebookParams.input){
|
||||||
// if (this.editor) {
|
this._notebookParams.input.setDirty(isDirty);
|
||||||
// this.editor.isDirty = isDirty;
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private actionItemProvider(action: Action): IActionItem {
|
private actionItemProvider(action: Action): IActionItem {
|
||||||
|
|||||||
@@ -169,4 +169,12 @@ export class NotebookInput extends EditorInput {
|
|||||||
save(): TPromise<boolean> {
|
save(): TPromise<boolean> {
|
||||||
return this._model.save();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user