Fix onchangelistener to use e.target

For some reason the change listener for the edit fields used e.srcElement, this didn't seem to work everywhere.
Using e.target should fix this.
This commit is contained in:
Hugvey Central Command 2019-05-13 14:12:54 +02:00
parent 8f8386505c
commit 480e8a49bc

View file

@ -1664,15 +1664,15 @@ class Graph {
let graph = this; let graph = this;
let el = function( e ) { let el = function( e ) {
console.info("Changed", e); console.info("Changed", e);
let parts = e.srcElement.name.split( '-' ); let parts = e.target.name.split( '-' );
let field = parts.pop(); let field = parts.pop();
let id = parts.join('-'); let id = parts.join('-');
let node = graph.getNodeById( id ); let node = graph.getNodeById( id );
let path = field.split( '.' ); // use vars.test to set ['vars']['test'] = value let path = field.split( '.' ); // use vars.test to set ['vars']['test'] = value
var res = node; var res = node;
let value = e.srcElement.value let value = e.target.value
if(e.srcElement.type == 'checkbox') { if(e.target.type == 'checkbox') {
value = e.srcElement.checked; value = e.target.checked;
} }
for ( var i = 0; i < path.length; i++ ) { for ( var i = 0; i < path.length; i++ ) {
if ( i == ( path.length - 1 ) ) { if ( i == ( path.length - 1 ) ) {