Sha256: 821bbacc6bc3a97a52457c2b9eb2759075cb043d5f0dc22b0002e331f400ee3e

Contents?: true

Size: 1001 Bytes

Versions: 4

Compression:

Stored size: 1001 Bytes

Contents

var triggerEvent,
    mouseButtonsEvent;
if (document.createEventObject) {
    triggerEvent = function(el, type, params) {
        var event = uki.extend(
            document.createEventObject(), 
            params
        );
        
        return el.fireEvent('on' + type, event);
    };
} else {
    triggerEvent = function(el, type, params) {
        var event = document.createEvent('MouseEvents');   
        event.initMouseEvent(
            type,
            true,
            true,
            document.defaultView,
            params.detail    || 0,
            params.screenX   || 0,
            params.screenY   || 0,
            params.clientX   || 0,
            params.clientY   || 0,
            params.ctrlKey   || false,
            params.altKey    || false,
            params.shiftKey  || false,
            params.metaKey   || false,
            params.button    || 0,
            null
        );
        uki.extend(event);
        
        el.dispatchEvent(event);
    };
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
uki-1.1.4 frameworks/uki/spec/support/spec.helper.js
uki-1.1.3 frameworks/uki/spec/support/spec.helper.js
uki-1.1.2 frameworks/uki/spec/support/spec.helper.js
uki-1.1.1 frameworks/uki/spec/support/spec.helper.js