Server IP : 150.95.80.236 / Your IP : 18.224.54.120 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/sc.pcu.in.th/demo15/src/js/custom/modals/ |
Upload File : |
"use strict"; // Class definition var KTModalUpgradePlan = function () { // Private variables var modal; var planPeriodMonthButton; var planPeriodAnnualButton; var changePlanPrices = function(type) { var items = [].slice.call(modal.querySelectorAll('[data-kt-plan-price-month]')); items.map(function (item) { var monthPrice = item.getAttribute('data-kt-plan-price-month'); var annualPrice = item.getAttribute('data-kt-plan-price-annual'); if ( type === 'month' ) { item.innerHTML = monthPrice; } else if ( type === 'annual' ) { item.innerHTML = annualPrice; } }); } var handlePlanPeriodSelection = function() { // Handle period change planPeriodMonthButton.addEventListener('click', function (e) { changePlanPrices('month'); }); planPeriodAnnualButton.addEventListener('click', function (e) { changePlanPrices('annual'); }); } var handleTabs = function() { KTUtil.on(modal, '[data-bs-toggle="tab"]', 'click', function(e) { this.querySelector('[type="radio"]').checked = true; }); } // Public methods return { init: function () { // Elements modal = document.querySelector('#kt_modal_upgrade_plan'); if (!modal) { return; } planPeriodMonthButton = modal.querySelector('[data-kt-plan="month"]'); planPeriodAnnualButton = modal.querySelector('[data-kt-plan="annual"]'); // Handlers handlePlanPeriodSelection(); handleTabs(); } } }(); // On document ready KTUtil.onDOMContentLoaded(function() { KTModalUpgradePlan.init(); });