mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-28 14:21:31 +00:00
Added a "unsaved changed" warning dialog for part, entity edits and system settings
This fixes issue #1368
This commit is contained in:
parent
ad0c60f766
commit
79c36494ea
21 changed files with 556 additions and 11 deletions
|
|
@ -83,6 +83,8 @@ export default class TristateCheckbox {
|
|||
|
||||
//Do a refresh to set the correct styling of the checkbox
|
||||
this._refresh();
|
||||
// Anchor the hidden input's default so dirty-form comparisons have a clean baseline.
|
||||
this._hiddenInput.defaultValue = this._hiddenInput.value;
|
||||
|
||||
this._element.addEventListener('click', this.click.bind(this));
|
||||
}
|
||||
|
|
@ -202,6 +204,9 @@ export default class TristateCheckbox {
|
|||
}
|
||||
|
||||
this._refresh();
|
||||
// Notify change listeners (e.g. dirty-form controller) since programmatic
|
||||
// value changes don't fire native change events.
|
||||
this._hiddenInput.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue