evamass / Trello Horizontal Board Scroll

// ==UserScript==
// @name         Trello Horizontal Board Scroll
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  trello trello.com horizontal board scroll
// @author       EVA MASS
// @match        https://trello.com/b/*
// @grant        none
// @run-at document-end
// @copyright 2018, evamass (https://openuserjs.org//users/evamass)
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function isEventSupported(eventName) {
        var el = document.createElement('div');
        eventName = 'on' + eventName;
        var isSupported = (eventName in el);
        if (!isSupported) {
            el.setAttribute(eventName, 'return;');
            isSupported = typeof el[eventName] == 'function';
        }
        el = null;
        return isSupported;
    }

    
    var wheelEvent = isEventSupported('mousewheel') ? 'mousewheel' : 'wheel';
    setTimeout(function(){
        console.log('Horizontal Scroll inited.');
        $('#board').on(wheelEvent, function(e) {
        var oEvent = e.originalEvent,
            delta  = oEvent.deltaY || oEvent.wheelDelta;

        if ($('.js-list-content:hover').length != 0) return;

        if (delta > 0) {
            document.getElementsByClassName('u-fancy-scrollbar')[0].scrollLeft+=delta;
        } else {
            document.getElementsByClassName('u-fancy-scrollbar')[0].scrollLeft+=delta;
        }
    });

    }, 5000);
    
})();