Fix action uri

This commit is contained in:
Dennis Eichhorn 2019-04-22 16:29:28 +02:00
parent 6321b9e02c
commit dcc262b64e
2 changed files with 16 additions and 1 deletions

View File

@ -345,6 +345,10 @@ export class Request {
*/
send()
{
if (this.uri === '') {
return;
}
const self = this;
if (this.xhr.readyState !== 1) {

View File

@ -286,6 +286,17 @@ export class FormView {
}
}
// Create FormData
/* todo: implement once we know how to handle this in the backend/php
const formData = new FormData(),
dataLength = data.length;
for (let key in data) {
if (data.hasOwnProperty(key)) {
formData.append(key, data[key].constructor === Array ? JSON.stringify(data[key]) : data[key]);
}
} */
return data;
};
@ -395,7 +406,7 @@ export class FormView {
}
this.method = typeof e.attributes['method'] !== 'undefined' ? e.attributes['method'].value : 'EMPTY';
this.action = typeof e.action !== 'undefined' ? e.action : 'EMPTY';
this.action = typeof e.getAttribute('action') !== 'undefined' ? e.getAttribute('action') : 'EMPTY';
const elements = this.getFormElements(),
length = elements.length;