Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : off-canvas.js
(function ($) {
    'use strict';

    $(function () {
        var $body = $('body');
        var $dropdownWrapper = $('body .motiox-dropdown-filter');
        $body.on('click', '.filter-toggle', function (e) {
            e.preventDefault();
            $('.filter-toggle').toggleClass('active-filter-toggle');
            if ($body.hasClass('shop_filter_dropdown') && $(window).width() > 1023) {
                $dropdownWrapper.toggleClass('active-dropdown').slideToggle();
            } else if ($body.hasClass('shop_filter_drawing') && $(window).width() > 1023) {

                const productsList = document.querySelector(".motiox-products-grid");
                $body.toggleClass('active-drawing');
                if ($body.hasClass('active-drawing')) {
                    productsList.className = productsList.dataset.filtersClosedClasses
                } else {
                    productsList.className = productsList.dataset.filtersOpenClasses
                }

            } else {
                $('html').toggleClass('off-canvas-active');

            }
            setTimeout(function () {
                $(window).trigger('resize');
            }, 1000)
        });

        $body.on('click', '.filter-close, .motiox-overlay-filter', function (e) {
            e.preventDefault();
            $('html').toggleClass('off-canvas-active');
        });

        function clone_sidebar() {
            var $canvas = $('.motiox-canvas-filter-wrap');
            if (!$('body').hasClass('shop_filter_canvas')) {
                if ($(window).width() < 1024) {
                    $('#secondary').children().appendTo(".motiox-canvas-filter-wrap");
                    $('.motiox-dropdown-filter-wrap').children().appendTo(".motiox-canvas-filter-wrap");
                } else {
                    $canvas.children().appendTo("#secondary");
                    $canvas.children().appendTo(".motiox-dropdown-filter-wrap");
                }
            }
        }

        // menu filter width min max
        function wooMenuFilter() {
            let $widget_filter = $('.motiox-menu-filter-wrap .widget'),
                count = $widget_filter.length,
                $parrent_filter = $('.motiox-sorting'),
                parrent_width = $parrent_filter.outerWidth(),
                child_width = 0;

            if ($widget_filter.length > 0) {
                $widget_filter.each((index, element) => {
                    child_width += $(element).outerWidth() + 30;
                    if (!--count) addClassActive(parrent_width, child_width, $parrent_filter);
                });
            }

            function addClassActive(parrent_width, child_width, $parrent_filter) {
                if (child_width > (parrent_width - 300)) {
                    $parrent_filter.addClass('active-filter-toggle');
                } else {
                    $parrent_filter.removeClass('active-filter-toggle');
                }
            }
        }

        $(document).ready(function () {
            clone_sidebar();
            wooMenuFilter();
        });

        $(window).on('resize', function () {
            wooMenuFilter();
            clone_sidebar();
        });
    });

})(jQuery);
© 2026 GrazzMean-Shell