mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-17 09:48:40 +00:00
enable data-action/data-method for non-form forms
This commit is contained in:
parent
dd974071d7
commit
549c46761e
|
|
@ -487,8 +487,21 @@ export class FormView {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.method = typeof e.attributes['method'] !== 'undefined' ? e.attributes['method'].value : 'EMPTY';
|
if (typeof e.attributes['method'] !== 'undefined') {
|
||||||
this.action = typeof e.getAttribute('action') !== 'undefined' ? e.getAttribute('action') : 'EMPTY';
|
this.method = e.attributes['method'].value;
|
||||||
|
} else if (typeof e.attributes['data-method'] !== 'undefined') {
|
||||||
|
this.method = e.attributes['data-method'].value;
|
||||||
|
} else {
|
||||||
|
this.method = 'EMPTY';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof e.attributes['action'] !== 'undefined') {
|
||||||
|
this.action = e.attributes['action'].value;
|
||||||
|
} else if (typeof e.attributes['data-action'] !== 'undefined') {
|
||||||
|
this.action = e.attributes['data-action'].value;
|
||||||
|
} else {
|
||||||
|
this.action = 'EMPTY';
|
||||||
|
}
|
||||||
|
|
||||||
const elements = this.getFormElements(),
|
const elements = this.getFormElements(),
|
||||||
length = elements.length;
|
length = elements.length;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user