mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-14 16:38:39 +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)
|
// todo: test if attach necessary (maybe already attached in event manager)
|
||||||
// Register normal form behavior
|
// Register normal form behavior
|
||||||
window.eventManager.attach(form.getId(), function ()
|
this.app.eventManager.attach(form.getId(), function ()
|
||||||
{
|
{
|
||||||
self.submitForm(form);
|
self.submitForm(form);
|
||||||
});
|
});
|
||||||
|
|
@ -164,15 +164,19 @@
|
||||||
for (let property in injects) {
|
for (let property in injects) {
|
||||||
if (injects.hasOwnProperty(property)) {
|
if (injects.hasOwnProperty(property)) {
|
||||||
counter++;
|
counter++;
|
||||||
window.eventManager.addGroup(form.getId(), counter);
|
this.app.eventManager.addGroup(form.getId(), counter);
|
||||||
injects[property](form.getElement(), counter, form.getId());
|
const result = injects[property](form, counter, form.getId());
|
||||||
|
|
||||||
|
if(result === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
jsOMS.Log.Logger.instance.warning('Invalid property.');
|
jsOMS.Log.Logger.instance.warning('Invalid property.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(counter === 0) {
|
if(counter === 0) {
|
||||||
window.eventManager.trigger(form.getId());
|
this.app.eventManager.trigger(form.getId());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,12 +79,6 @@
|
||||||
*/
|
*/
|
||||||
jsOMS.Views.FormView.prototype.getSubmit = function ()
|
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]');
|
return document.querySelectorAll('#' + this.id + ' input[type=submit], button[form=' + this.id + '][type=submit]');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user