/**
 * Simpler Event dispatching
 */
class EventHandler {

    /**
     * @param {HTMLElement} target
     * @param {String} name
     */
    constructor(target, name) {

        this.target = target;
        this.defaultOptions = {
            bubbles: true,
            cancelable: true
        };

        this.name = name;
    }

    /**
     * Set more options
     * @param {Object} options
     * @returns {EventHandler}
     */
    withOptions(options) {
        Object.assign(this.defaultOptions, (options || {}));
        return this;
    }

    /**
     * @param {Event} e
     * @returns {EventHandler}
     */
    withOriginal(e) {
        this.defaultOptions.originalEvent = e;
        return this;
    }

    /**
     * @param {*} o
     * @returns {EventHandler}
     */
    withDetail(o) {
        this.defaultOptions.detail = o;
        return this;
    }

    /**
     * @returns {Window.CustomEvent}
     */
    fire() {
        var e = new CustomEvent(this.name, this.defaultOptions);
        if(this.target) {
            this.target.dispatchEvent(e);
        }
        return e;
    }
}

export default class Event {
    /**
     * Dispatches a custom event
     * @param {HTMLElement} target
     * @param {String} name
     * @returns {EventHandler}
     */
    static dispatch(target, name) {
        return new EventHandler(target, name);
    }

    /**
     * Dispatches a custom event
     * @param {HTMLElement} target
     * @param {String} name
     * @param {Object} [options]
     * @returns {Window.CustomEvent}
     */
    static dispatchAndFire(target, name, options) {
        return new EventHandler(target, name).withOptions(options).fire();
    }
}

@@ -1,12 +1,755 @@
+// polyfill for custom events to make thinks work in IE%0A// The needed polyfill is so small that I embedded it here%0Avoid function () %7B%0A    if (!global.CustomEvent %7C%7C typeof global.CustomEvent !== 'function') %7B%0A        var CustomEvent;%0A        CustomEvent = function (event, params) %7B%0A            var evt;%0A            params = params %7C%7C %7B%0A                bubbles: false,%0A                cancelable: false,%0A                detail: undefined%0A            %7D;%0A            evt = document.createEvent(%22CustomEvent%22);%0A            evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);%0A            return evt;%0A        %7D;%0A        CustomEvent.prototype = global.Event.prototype;%0A        global.CustomEvent = CustomEvent;%0A    %7D%0A%7D();%0A%0A
 /**%0A * Simpl
@@ -1752,16 +1752,17 @@
       if
+ 
 (this.ta
@@ -1862,17 +1862,17 @@
  default
- 
+%0A
 class Ev

add custom event polyfill