mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
Fix multiple submit buttons
This commit is contained in:
parent
9439738e05
commit
c610b6a0ce
|
|
@ -109,6 +109,11 @@
|
|||
console.log(action.type);
|
||||
console.log(this.actions);
|
||||
|
||||
if (!this.actions.hasOwnProperty(action.type)) {
|
||||
console.log('Undefined action ' + action.type);
|
||||
return;
|
||||
}
|
||||
|
||||
this.actions[action.type](action, function ()
|
||||
{
|
||||
self.app.eventManager.trigger(e.id + action.type, e.id);
|
||||
|
|
|
|||
|
|
@ -110,11 +110,16 @@
|
|||
|
||||
this.unbind(id);
|
||||
|
||||
this.forms[id].getSubmit().addEventListener('click', function (event)
|
||||
{
|
||||
jsOMS.preventAll(event);
|
||||
self.submit(self.forms[id]);
|
||||
});
|
||||
let submits = this.forms[id].getSubmit(),
|
||||
length = submits.length;
|
||||
|
||||
for(let i = 0; i < length; i++) {
|
||||
submits[i].addEventListener('click', function (event)
|
||||
{
|
||||
jsOMS.preventAll(event);
|
||||
self.submit(self.forms[id]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
*/
|
||||
jsOMS.Views.FormView.prototype.getSubmit = function ()
|
||||
{
|
||||
return document.getElementById(this.id).querySelectorAll('input[type=submit]')[0];
|
||||
return document.getElementById(this.id).querySelectorAll('input[type=submit]');
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user