Skip to content
Snippets Groups Projects
Commit e2b01b5a authored by Nathan Bockisch's avatar Nathan Bockisch
Browse files

WS-1813: Add save and save and close buttons to editor

parent 1f9c763d
No related branches found
No related tags found
2 merge requests!1452Merge 2.8.2 to main,!1399WS-1813: Add save and save and close buttons to editor
Pipeline #10205 passed
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-outline-secondary mr-auto" (click)="undoEditChanges()">Revert Changes</button> <button type="button" class="btn btn-outline-secondary mr-auto" (click)="undoEditChanges()">Revert Changes</button>
<button type="button" class="btn btn-secondary" (click)="modal.close('exit')">Cancel</button> <button type="button" class="btn btn-secondary" (click)="modal.close('exit')">Cancel</button>
<button type="button" class="btn btn-primary" mdbBtn (click)="modal.close('save')">Save</button> <button type="button" class="btn btn-primary" mdbBtn (click)="this.newEditEvent.emit(this.editedData)">Save</button>
<button type="button" class="btn btn-primary" mdbBtn (click)="modal.close('save-and-close')">Save and Close</button>
</div> </div>
</ng-template> </ng-template>
...@@ -51,7 +51,7 @@ export class EditorComponent implements OnInit { ...@@ -51,7 +51,7 @@ export class EditorComponent implements OnInit {
this.toggleEditorOpen() this.toggleEditorOpen()
this.modalService.open(content, { ariaLabelledBy: "modal-title", centered: true, size: "lg" }).result.then( this.modalService.open(content, { ariaLabelledBy: "modal-title", centered: true, size: "lg" }).result.then(
(result) => { (result) => {
if (result === "save" && this.editedData) { if (result === "save-and-close" && this.editedData) {
// "Save" button clicked; emit edited data to parent component // "Save" button clicked; emit edited data to parent component
this.newEditEvent.emit(this.editedData) this.newEditEvent.emit(this.editedData)
this.toggleEditorOpen() this.toggleEditorOpen()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment