HEX
Server: LiteSpeed
System: Linux linux31.centraldnserver.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: salamatk (1501)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: /home/salamatk/.trash/woodmart1/inc/admin/assets/js/vc-fields/switch.js
(function ($) {
    const wdSwitcherBtnInit = function () {
        $('.xts-switcher-btn').each(function() {
            var $switcherBtn = $(this);

            if ( $switcherBtn.hasClass('wd-inited') ) {
                return;
            }

            $switcherBtn.on('click', function () {
                var $this = $(this);
                var value = '';

                if ($this.hasClass('xts-active')) {
                    value = $this.data('off');
                    $this.removeClass('xts-active');
                } else {
                    value = $this.data('on');
                    $this.addClass('xts-active');
                }

                $this.find('.switch-field-value').val(value).trigger('change');
            });

            $switcherBtn.addClass('wd-inited');
        });
    }

    $('#vc_ui-panel-edit-element').on('vcPanel.shown click > .vc_controls [data-vc-control="clone"]', function () {
        wdSwitcherBtnInit();
    });
})(jQuery);