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',
'.multiple-input-word',
'.contributor-role-select',
// '.edit-permissions-btn',
'.add-contributor-btn',
'input[type=checkbox]',
];
elementsSelectors.forEach(selector => {
const elements: NodeListOf<HTMLElement> =
document.querySelectorAll(selector);
elements.forEach(element => {
initAlertOnClick(element);
if (window.location.href.includes('/settings')) {
elementsSelectors.forEach(selector => {
const elements: NodeListOf<HTMLElement> =
document.querySelectorAll(selector);
elements.forEach(element => {
initAlertOnClick(element);
});
});
});
}
const elementsOnClickPrevent = document.querySelectorAll(
'.prevent-unsaved-changes-event',