Fire an event on a custom object
@param {Object} el
@param {String} type
@param {Object} eventArguments
@param {Function} defaultFunction
514686
function (el, type, eventArguments, defaultFunction) {
			var event = $.Event(type),
				detachedType = 'detached' + type,
				defaultPrevented;
	
			// Remove warnings in Chrome when accessing layerX and layerY. Although Highcharts
			// never uses these properties, Chrome includes them in the default click event and
			// raises the warning when they are copied over in the extend statement below.
			//
			// To avoid problems in IE (see #1010) where we cannot delete the properties and avoid
			// testing if they are there (warning in chrome) the only option is to test if running IE.
			if (!isIE && eventArguments) {
				delete eventArguments.layerX;
				delete eventArguments.layerY;
			}
	
			extend(event, eventArguments);
	
			// Prevent jQuery from triggering the object method that is named the
			// same as the event. For example, if the event is 'select', jQuery
			// attempts calling el.select and it goes into a loop.
			if (el[type]) {
				el[detachedType] = el[type];
				el[type] = null;
			}
	
			// Wrap preventDefault and stopPropagation in try/catch blocks in
			// order to prevent JS errors when cancelling events on non-DOM
			// objects. #615.
			/*jslint unparam: true*/
			$.each(['preventDefault', 'stopPropagation'], function (i, fn) {
				var base = event[fn];
				event[fn] = function () {
					try {
						base.call(event);
					} catch (e) {
						if (fn === 'preventDefault') {
							defaultPrevented = true;
						}
					}
				};
			});
			/*jslint unparam: false*/
	
			// trigger it
			$(el).trigger(event);
	
			// attach the method
			if (el[detachedType]) {
				el[type] = el[detachedType];
				el[detachedType] = null;
			}
	
			if (defaultFunction && !event.isDefaultPrevented() && !defaultPrevented) {
				defaultFunction(event);
			}
		}
856215
function emitAndFire(widget, eventName, eventArg) {
    const originalEmit = widget.emit;
    let event;
    if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
        event = new CustomEvent(eventName, { detail: eventArg });
    } else {
        event = document.createEvent('CustomEvent');
        event.initCustomEvent(eventName, true, true, eventArg);
    }
    widget.el.dispatchEvent(event);
    originalEmit.call(widget, eventName, eventArg);
}
790579
function(type, args) {
        Base.prototype.fireEvent.call(this, type, args);

        var element = this.element,
            node = this.node,
            event = $.Event(type + '.toolkit.' + this.keyName);
            event.context = this;

        // Trigger event on the element and the node
        if (element) {
            element.trigger(event, args || []);
        }

        if (node) {
            node.trigger(event, args || []);
        }
    }
1010897
function dispatchEvent(event) {
    var type = event.type;
    var listeners = this._eventListeners[type] || [];

    for (var i = 0; i < listeners.length; i++) {
      if (typeof listeners[i] == "function") {
        listeners[i].call(this, event);
      } else {
        listeners[i].handleEvent(event);
      }
    }

    return !!event.defaultPrevented;
  }
877435
function fire(event) {
		if (typeof event !== 'string') {
			throw new Error('"event" not a string');
		}

		// any listeners registered?
		if (!hasListeners(event)) {
			return triggerObject;
		}

		// get optional arguments
		var args = Array.prototype.slice.call(arguments, 1);

		// invoke listener functions
		listeners[event].slice(0).forEach(function(fn) {
			fn.apply(global, args);
		});

		return triggerObject;
	}
618068
function(name) {
		var args = arguments;
		args[0] = this.eventName(name);
		$.fn.on.apply(this.$el, args);
	}
730979
function(eventName, args) {

      // Run interactions
      var fieldValue = args[0];
      var fieldInstance = args[1];
      this.runInteractions(fieldInstance,fieldValue);
      
      //this.setClassFromState();
      
      this.fireUpdatedEvt();
   }
438207
function( event, element, type, autoPrevent ) {

			// dispatchEvent doesn't always work in IE (mostly in a popup)
			if ( element.dispatchEvent && event ) {
				var preventDefault = event.preventDefault,
					prevents = autoPrevent ? -1 : 0;

				//automatically prevents the default behavior for this event
				//this is to protect agianst nasty browser freezing bug in safari
				if ( autoPrevent ) {
					bind(element, type, function( ev ) {
						ev.preventDefault();
						unbind(this, type, arguments.callee);
					});
				}


				event.preventDefault = function() {
					prevents++;
					if (++prevents > 0 ) {
						preventDefault.apply(this, []);
					}
				};
				element.dispatchEvent(event);
				return prevents <= 0;
			} else {
				try {
					window.event = event;
				} catch (e) {}
				//source element makes sure element is still in the document
				return element.sourceIndex <= 0 || (element.fireEvent && element.fireEvent('on' + type, event));
			}
		}
608337
function fire (event, $el, evt) {
    var handler = $el.data('dragon-opts')[event];
    // Patch the proxied Event Object
    evt.target = $el[0];
    if (handler) {
      handler(evt);
    }

    $el.trigger(event);
  }
800202
function( type ) {

      var emitter = this
      var listeners = this._events[ type ]

      if( type === 'error' && !listeners ) {
        if( !this._events.error ) {
          throw !( arguments[1] instanceof Error ) ?
            new Error( 'Unhandled "error" event.' ) :
            arguments[1]
        }
      } else if( !listeners ) {
        return false
      }

      var argv = [].slice.call( arguments, 1 )
      var i, len = listeners.length

      function fire( handler, argv ) {
        typeof handler !== 'function' ?
          handler.handleEvent.apply( handler, argv ) :
          handler.apply( this, argv )
      }

      for( i = 0; i < len; i++ ) {
        Emitter.nextTick(
          fire.bind( this, listeners[i], argv )
        )
      }

      return true

    }
261328
function(typeEvents) {
    var elemClasses, elemClass;

    // Iterate over previously passed elements to check for any delegated events
    var activePathLength = activePath.length;
    for (var i = 0; i < activePathLength; i++) {
      elemClasses = activePath[i].classes;
      // Once stopPropagation is called stop
      if (!evt.isPropagationStopped()) {
        var elemClassesLength = elemClasses.length;
        for (var j = 0; j < elemClassesLength; j++) {
          elemClass = elemClasses[j];
          if (typeEvents[elemClass]) {
            triggerEventFunctions(activePath[i].element, typeEvents[elemClass], elemClass, elem);
          }
        }
      }
    }

    // Check for any non-delegated events
    if (!evt.isPropagationStopped() && typeEvents.self) {
      triggerEventFunctions(elem, typeEvents.self);
    }
  }
121890
private <C> void fireEventToCell(Event event, String eventType, Element parentElem,
                                     final T rowValue, Context context, HasCell<T, C> column) {
        // Check if the cell consumes the event.
        Cell<C> cell = column.getCell();
        if (!cellConsumesEventType(cell, eventType)) {
            return;
        }

        C cellValue = column.getValue(rowValue);
        boolean cellWasEditing = cell.isEditing(context, parentElem, cellValue);
        if (column instanceof Column) {
          /*
           * If the HasCell is a Column, let it handle the event itself. This is
           * here for legacy support.
           */
            Column<T, C> col = (Column<T, C>) column;
            col.onBrowserEvent(context, parentElem, rowValue, event);
        } else {
            // Create a FieldUpdater.
            final FieldUpdater<T, C> fieldUpdater = column.getFieldUpdater();
            final int index = context.getIndex();
            ValueUpdater<C> valueUpdater = (fieldUpdater == null) ? null : (value) -> {
                fieldUpdater.update(index, rowValue, value);
            };

            // Fire the event to the cell.
            cell.onBrowserEvent(context, parentElem, cellValue, event, valueUpdater);
        }
831033
function(element, type, handler) {
    var types = type.split(' ');
    Utils.each(types, function(type){
      element.addEventListener(type, handler, false);
    });
  }
485876
function buildEventObject(type, data) {
        var isDefaultPrevented = false;
        return {
            type: type,
            data: data,

            /**
             * Prevent the default action for this event
             * @returns {void}
             */
            preventDefault: function () {
                isDefaultPrevented = true;
            },

            /**
             * Return true if preventDefault() has been called on this event
             * @returns {Boolean}
             */
            isDefaultPrevented: function () {
                return isDefaultPrevented;
            }
        };
    }
371654
function(name, container, args, events) {
      /* handling for any default values if args are not specified */
      var mergeDefaults = function(args, defaults) {
        var args = args || {};

        if (typeof defaults == 'object') {
          for (var key in defaults) {
            if (elation.utils.isNull(args[key])) {
              args[key] = defaults[key];
            }
          }
        }
        
        return args;
      };

      var realname = name;
      if (elation.utils.isObject(name)) {
        // Simple syntax just takes an object with all arguments
        args = name;
        realname = elation.utils.any(args.id, args.name, null);
        container = (!elation.utils.isNull(args.container) ? args.container : null);
        events = (!elation.utils.isNull(args.events) ? args.events : null);
      }

      // If no args were passed in, we're probably being used as the base for another 
      // component's prototype, so there's no need to go through full init
      if (elation.utils.isNull(realname) && !container && !args) {
        var obj = new component.base(type);
        
        // apply default args
        obj.args = mergeDefaults(obj.args, elation.utils.clone(obj.defaults));
        
        return obj;
      }

      // If no name was passed, use the current object count as a name instead ("anonymous" components)
      if (elation.utils.isNull(realname) || realname === "") {
        realname = component.objcount;
      }

      if (!component.obj[realname] && !elation.utils.isEmpty(args)) {
        component.obj[realname] = obj = new component.base(type);
        component.objcount++;
      //}
      // TODO - I think combining this logic would let us use components without needing HTML elements for the container
      //if (component.obj[realname] && container !== undefined) {
        component.obj[realname].componentinit(type, realname, container, args, events);

/*
        if (component.extendclass) {
          component.obj[realname].initSuperClass(component.extendclass);
        }
*/
        // fix handling for append component infinite recursion issue
        if (args.append instanceof elation.component.base) 
          args.append = args.append.container;

        if (args.before instanceof elation.component.base) 
          args.before = args.before.container;

        // apply default args
        try {
          if (typeof obj.defaults == 'object')
            args = mergeDefaults(args, elation.utils.clone(obj.defaults));

          var parentclass = component.extendclass;

          // recursively apply inherited defaults
          while (parentclass) {
            if (typeof parentclass.defaults == 'object')
              elation.utils.merge(mergeDefaults(args, elation.utils.clone(parentclass.defaults)),args);

            parentclass = parentclass.extendclass;
          }
        } catch (e) {
          console.log('-!- Error merging component args', e.msg);
        }

        if (typeof obj.init == 'function') {
          obj.init(realname, container, args, events);
        }
      }
      return component.obj[realname];
    }
138917
function(self, types, fn) {
		var type;
		var trigger = self.trigger;
		var event_args = {};
	
		// override trigger method
		self.trigger = function() {
			var type = arguments[0];
			if (types.indexOf(type) !== -1) {
				event_args[type] = arguments;
			} else {
				return trigger.apply(self, arguments);
			}
		};
	
		// invoke provided function
		fn.apply(self, []);
		self.trigger = trigger;
	
		// trigger queued events
		for (type in event_args) {
			if (event_args.hasOwnProperty(type)) {
				trigger.apply(self, event_args[type]);
			}
		}
	}
91582
function VKI_addListener(elem, type, func, cap) {
    if (elem.addEventListener) {
      elem.addEventListener(type, function(e) { func.call(elem, e); }, cap);
    } else if (elem.attachEvent)
      elem.attachEvent('on' + type, function() { func.call(elem); });
  }