Adjust todos and add loggign

This commit is contained in:
Dennis Eichhorn 2018-11-23 11:36:32 +01:00
parent 577af40f56
commit 20c4176c52
3 changed files with 7 additions and 4 deletions

View File

@ -120,7 +120,6 @@
} }
if (!this.hasOutstanding(group)) { if (!this.hasOutstanding(group)) {
// todo if it is route then call dispatcher?
this.callbacks[group].lastRun = Date.now(); this.callbacks[group].lastRun = Date.now();
this.callbacks[group].func(data); this.callbacks[group].func(data);

View File

@ -30,10 +30,9 @@
this.requestHeader['Content-Type'] = this.setContentTypeBasedOnType(this.type); this.requestHeader['Content-Type'] = this.setContentTypeBasedOnType(this.type);
// todo: create log;
this.result[0] = function() this.result[0] = function()
{ {
//console.log('invalid response'); jsOMS.Log.Logger.instance.error('Invalid response code.');
}; };
/** global: XMLHttpRequest */ /** global: XMLHttpRequest */
@ -387,7 +386,7 @@
} }
break; break;
default: default:
// todo: create handler for error returns jsOMS.Log.Logger.instance.warning('Unhandled ready state change.');
} }
}; };

View File

@ -158,6 +158,11 @@
external = document.querySelectorAll('[form=' + this.id + ']'), external = document.querySelectorAll('[form=' + this.id + ']'),
inputLength = inputs.length; inputLength = inputs.length;
// todo: handle trigger element. check which element triggered the submit and pass it's name+value
// the reason for this is, there may be multiple buttons in a form which trigger a send
// sometimes even a checkbox or drop down could trigger a send
// Maybe it makes sense to do this however at a different place e.g. the actual data submit
for (let i = 0; i < inputLength; ++i) { for (let i = 0; i < inputLength; ++i) {
if (inputs[i].type === 'checkbox' && !inputs[i].checked) { if (inputs[i].type === 'checkbox' && !inputs[i].checked) {
delete inputs[i]; delete inputs[i];