fix initUnsavedChangedAlerts

This commit is contained in:
SvyatoslavArtymovych 2023-06-16 10:06:04 +03:00
parent b36cb9a9be
commit 906c581dbf
2 changed files with 9 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -20,18 +20,19 @@ export const initUnsavedChangedAlerts = () => {
'.book-tags-input', '.book-tags-input',
'.multiple-input-word', '.multiple-input-word',
'.contributor-role-select', '.contributor-role-select',
// '.edit-permissions-btn',
'.add-contributor-btn', '.add-contributor-btn',
'input[type=checkbox]', 'input[type=checkbox]',
]; ];
elementsSelectors.forEach(selector => { if (window.location.href.includes('/settings')) {
const elements: NodeListOf<HTMLElement> = elementsSelectors.forEach(selector => {
document.querySelectorAll(selector); const elements: NodeListOf<HTMLElement> =
elements.forEach(element => { document.querySelectorAll(selector);
initAlertOnClick(element); elements.forEach(element => {
initAlertOnClick(element);
});
}); });
}); }
const elementsOnClickPrevent = document.querySelectorAll( const elementsOnClickPrevent = document.querySelectorAll(
'.prevent-unsaved-changes-event', '.prevent-unsaved-changes-event',