mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-26 00:18:40 +00:00
fix form injection
This commit is contained in:
parent
ddccff7511
commit
183503f31c
|
|
@ -155,7 +155,7 @@
|
|||
|
||||
// todo: test if attach necessary (maybe already attached in event manager)
|
||||
// Register normal form behavior
|
||||
window.eventManager.attach(form.getId(), function ()
|
||||
this.app.eventManager.attach(form.getId(), function ()
|
||||
{
|
||||
self.submitForm(form);
|
||||
});
|
||||
|
|
@ -164,15 +164,19 @@
|
|||
for (let property in injects) {
|
||||
if (injects.hasOwnProperty(property)) {
|
||||
counter++;
|
||||
window.eventManager.addGroup(form.getId(), counter);
|
||||
injects[property](form.getElement(), counter, form.getId());
|
||||
this.app.eventManager.addGroup(form.getId(), counter);
|
||||
const result = injects[property](form, counter, form.getId());
|
||||
|
||||
if(result === false) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
jsOMS.Log.Logger.instance.warning('Invalid property.');
|
||||
}
|
||||
}
|
||||
|
||||
if(counter === 0) {
|
||||
window.eventManager.trigger(form.getId());
|
||||
this.app.eventManager.trigger(form.getId());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,6 @@
|
|||
*/
|
||||
jsOMS.Views.FormView.prototype.getSubmit = function ()
|
||||
{
|
||||
const e = document.getElementById(this.id);
|
||||
|
||||
if(!e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return document.querySelectorAll('#' + this.id + ' input[type=submit], button[form=' + this.id + '][type=submit]');
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user