Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IWCL_HookEvent in IWCommon.js correct?
#1
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.

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;
       }
Reply


Messages In This Thread
IWCL_HookEvent in IWCommon.js correct? - by jeroen.rottink - 02-28-2019, 06:09 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)