jQuery(document).on('see-list-events-loaded', null, null, decideListViewStyle);
function decideListViewStyle ()
{
    jQuery('.seetickets-list-event-container').each(function (index, eventCard) {
        if (jQuery(eventCard).data('listtype') === 'list') {

            if ( 
                (jQuery(eventCard).parents('.list-view-events').width() < 576 && jQuery(eventCard).parents('.list-view-events').width() > 0) ||
                (jQuery(eventCard).parents('#list-view-events').width() < 576 && jQuery(eventCard).parents('#list-view-events').width() > 0)
            ) {
                jQuery(eventCard).parents('.seetickets-list-events').addClass('grid-container');
                jQuery(eventCard).parents('.seetickets-list-events').addClass('display-flex');
                jQuery(eventCard).find('.seetickets-list-event-content-container').removeClass('ml-2r').css('order', '2');
                jQuery(eventCard).find('.seetickets-list-view-event-image-container').css('order', '1');
                jQuery(eventCard).find('.seetickets-list-view-event-image').css('width', evuselListSettings.imageWidth);
                jQuery(eventCard).find('.seetickets-list-view-event-image').css('height', evuselListSettings.imageWidth);
                jQuery(eventCard).addClass('grid-item');
                jQuery(eventCard).find('.buy-and-share-block').removeClass('position-absolute');
                if (jQuery(eventCard).hasClass('grid-item')) {
                    jQuery(eventCard).css('width', evuselListSettings.gridWidth + 'px');
                }
            } else {
                if (jQuery(eventCard).hasClass('grid-item')) {
                    jQuery(eventCard).css('width', '');
                }
                jQuery(eventCard).parents('.seetickets-list-events').removeClass('display-flex');
                jQuery(eventCard).find('.seetickets-list-event-content-container').addClass('ml-2r').css('order', 'initial');
                jQuery(eventCard).find('.seetickets-list-view-event-image-container').css('order', 'initial');
                jQuery(eventCard).find('.seetickets-list-view-event-image').css('width', '275px');
                jQuery(eventCard).find('.seetickets-list-view-event-image').css('height', '275px');
                jQuery(eventCard).removeClass('grid-item');
                jQuery(eventCard).find('.buy-and-share-block').addClass('position-relative');
            }
        }
    });
}

function pageNumberScrollTop(){
	window.scrollTo({
		top: jQuery(document.getElementById('list-view-event')).offset().top,
		behavior: "smooth",
	});
}
