mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 12:08:47 +02:00
test and corrections
This commit is contained in:
@@ -3,12 +3,25 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
$aFormBlockDataTransmittedData = {};
|
||||
|
||||
function triggerTurbo(el) {
|
||||
let sFormName = el.form.getAttribute("name");
|
||||
el.form.querySelector(`[name="${sFormName}[_turbo_trigger]"]`).value = el.getAttribute('name');
|
||||
el.form.setAttribute('novalidate', true);
|
||||
el.form.requestSubmit();
|
||||
console.log('Auto submitting form due to change in field ' + el.getAttribute('name'));
|
||||
|
||||
const name = el.getAttribute('name');
|
||||
|
||||
if(isCheckbox(el) || $aFormBlockDataTransmittedData[name] !== el.value) {
|
||||
let sFormName = el.form.getAttribute("name");
|
||||
el.form.querySelector(`[name="${sFormName}[_turbo_trigger]"]`).value = el.getAttribute('name');
|
||||
el.form.setAttribute('novalidate', true);
|
||||
el.form.requestSubmit();
|
||||
$aFormBlockDataTransmittedData[name] = el.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function isCheckbox (element) {
|
||||
return element instanceof HTMLInputElement
|
||||
&& element.getAttribute('type') === 'checkbox'
|
||||
}
|
||||
|
||||
function addFormToCollection(e) {
|
||||
|
||||
Reference in New Issue
Block a user