<?php

/**
 * @package     VP Neoteric
 *
 * @author      Abhishek Das <info@virtueplanet.com>
 * @link        https://www.virtueplanet.com
 * @copyright   Copyright (C) 2023-2025 Virtueplanet Services LLP. All Rights Reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

if (VmConfig::get('jdynupdate', true)) {
    $script = <<<EOT
jQuery(document).ready(function($) {
    Virtuemart.stopVmLoading();
    $('a[data-dynamic-update="1"]').off('click', Virtuemart.startVmLoading).on('click', {msg :''}, Virtuemart.startVmLoading);
    $('[data-dynamic-update="1"]').off('change', Virtuemart.startVmLoading).on('change', {msg: ''}, Virtuemart.startVmLoading);
});
EOT;

    vmJsApi::addJScript('vmPreloader', $script);
}

echo vmJsApi::writeJS();
