Skip to content

Commit

Permalink
Merge pull request #87 from DDMAL/status-fix
Browse files Browse the repository at this point in the history
Update saved status if not loading data
  • Loading branch information
yinanazhou authored Jul 2, 2024
2 parents 1d5a31c + 888f8dc commit 1efb86b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
16 changes: 0 additions & 16 deletions src/CressView.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import setBody from './utils/Template';
import * as Validation from './Validation';
import { ModalWindow } from './utils/ModalWindow';
import { CressTable } from './Editor/CressTable';
import { ModalWindowInterface } from './Interfaces';
Expand Down Expand Up @@ -51,21 +50,6 @@ class CressView {
})
.then(() => {});
}

/**
* Save the current state to the browser database.
*/
// save (): Promise<void> {
// setSavedStatus(true);
// return this.core.updateDatabase();
// }

/**
* Deletes the local database of the loaded MEI file(s).
*/
// deleteDb (): Promise<void[]> {
// return this.core.deleteDb();
// }
}

export { CressView as default };
4 changes: 2 additions & 2 deletions src/Editor/CressTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export class CressTable {
dropdownMenu: true,
className: 'table-menu-btn',
licenseKey: 'non-commercial-and-evaluation',
afterChange() {
setSavedStatus(false);
afterChange(changes, source) {
if (source != 'loadData') setSavedStatus(false);
this.validateCells();
},
beforeValidate: (value) => this.setProcessStatus(value),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Unsaved.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function updateIndicator(): void {
}

/**
* Set the saved status of the folio
* Set the saved status of the file
*
* @param status boolean value. true if status is "saved", false if "not saved"
*/
Expand Down

0 comments on commit 1efb86b

Please sign in to comment.