mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-28 02:33:42 -04:00
Use submitThisForm() only if there is no 'data-on-change' == 'submitThisForm' attribute (skin.js)
- We need to find the 'data-on-change' attribute either on the current "target" object or, when using "chosen", on the source object from which the "chosen" element was created. If there is no attribute (for example for text fields), then we execute submitThisForm()
This commit is contained in:
@@ -1792,7 +1792,15 @@ function handleKeydownGeneral(evt) {
|
||||
// Controls pressing "Enter" inside the sliding panel from Sidebar. Used to submit the form to the Console page.
|
||||
if (navbar_type == 'left' && key == 'Enter') {
|
||||
if (SIDEBAR_MAIN_EXTRUDER.contains(target)) {
|
||||
//submitThisForm();
|
||||
if (target.getAttribute('data-on-change')) {
|
||||
return;
|
||||
} else {
|
||||
const chosenContainer = target.closest('.chosen-container');
|
||||
if (chosenContainer && chosenContainer.previousElementSibling.getAttribute('data-on-change') == 'submitThisForm') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
submitThisForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user