$(function()
{
    const checkOverflow = function ()
    {
        let liCount      = $('.timeaxis-line > ul > li').length;
        let liWidth      = $('.timeaxis-line > ul > li').width();
        let liTotalWidth = liWidth * liCount;
        let ulWidth      = $('.timeaxis-line').width();
        if (liTotalWidth + 200 > ulWidth)
        {
            $('.timeaxis-line ul').css('width', liTotalWidth + 40 + 'px');
            $('.timeaxis-line').prop('scrollLeft', liTotalWidth + 40);
        }
        $('.timeaxis-line').css('overflow-x', 'hidden');
    }
    $('.timeaxis-line').on('mouseenter', function()
    {
        $(this).css('overflow-x', 'auto');
    }).on('mouseleave', function()
    {
        $(this).css('overflow-x', 'hidden');
    });
    checkOverflow();
});
