src/aria/html/Element.js
function (listeners, eventType, callback, after) {
                var listArray = listeners[eventType] || [];
                if (!ariaUtilsType.isArray(listArray)) {
                    listArray = [listArray];
                }

                if (after) {
                    listArray.push(callback);
                } else {
                    listArray.splice(0, 0, callback);
                }
                listeners[eventType] = listArray;
            }
function (listeners, eventType, callback, after) {
                var listArray = listeners[eventType] || [];
                if (!ariaUtilsType.isArray(listArray)) {
                    listArray = [listArray];
                }

                if (after) {
                    listArray.push(callback);
                } else {
                    listArray.splice(0, 0, callback);
                }
                listeners[eventType] = listArray;
            }
function ( listeners , eventType , callback , after ) { var listArray = listeners [ eventType ] || [ ] ; if ( ! ariaUtilsType . isArray ( listArray ) ) { listArray = [ listArray ] ; } if ( after ) { listArray . push ( callback ) ; } else { listArray . splice ( 0 , 0 , callback ) ; } listeners [ eventType ] = listArray ; }
Add a listener for an event. It will be called before an already registered event, if any.
@protected
@param {aria.html.beans.ElementCfg:Properties.on} listeners Map of listeners
@param {String} eventType Type of the event
@param {aria.core.CfgBeans:Callback} callback listener to chain
@param {Boolean} after True if the listener has to be executed after all the other listeners. Otherwise,
it will be executed before
Add a listener for an event . It will be called before an already registered event if any .