02-28-2019, 06:09 PM
This function is called internally by IW to attach an event handler to an object. For example an onclick event.
If the html already declares an onclick event listener for that object, IWCL_HookEvent moves this original event handler to an internal structure (array[]) and adds the new one.
This way they both get called I presumed but that didn't work.
Debugging the code I am not sure if following is ok.
If the html already declares an onclick event listener for that object, IWCL_HookEvent moves this original event handler to an internal structure (array[]) and adds the new one.
This way they both get called I presumed but that didn't work.
Debugging the code I am not sure if following is ok.
Code:
IWCL_HookEvent: function(eventName, eventHandler) {
var i = IW.Events.findByName(eventName);
logMessage("IWCL_HookEvent(): eventName = " + eventName);
if (this.IEEventHandlers[i] == null) {
this.IEEventHandlers[i] = [];
var xEventName = "on" + eventName;
if (this[xEventName] != null) {
this.IEEventHandlers[0] = this[xEventName] // <<-- replace with this.IEEventHandlers[i][0] = this[xEventName] ?????
}
this[xEventName] = IW.Events.IWEventHandler;
}