Fix multiple submit buttons

This commit is contained in:
Dennis Eichhorn 2016-09-03 10:43:10 +02:00
parent 9439738e05
commit c610b6a0ce
3 changed files with 16 additions and 6 deletions

View File

@ -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);

View File

@ -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]);
});
}
};
/**

View File

@ -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]');
};
/**