PageSourceSearch

https://mtod.ir/wp-content/cache/min/1/wp-content/themes/studiare/inc/header/assets/header.js?ver=1790263199

js mtod.ir collected 2026-09-25 11:14:02 UTC 3,243 bytes, 20 lines download raw bytes

1(function($){'use strict';const RENDERED='rendered';function productSkeleton(){let html='';for(let i=0;i<4;i++){html+=`
2                <li class="product-item skeleton">
3                    <div class="thumb"></div>
4                    <div class="content">
5                        <span class="product-title"></span>
6                        <span class="product-price"></span>
7                    </div>
8                </li>
9            `}
10return html}
11function initHeaderCategoryMenu(){const $menu=$('.header-product-category-menu');$menu.on('mouseenter','.sub-categories > li.has-products',function(){const $item=$(this);const subId=$item.data('sub-id');if($item.hasClass(RENDERED)||!subId)return;$item.addClass(RENDERED);$item.addClass('loading');const $productList=$('<ul/>',{class:'children product-list skeleton-wrapper'});$productList.html(productSkeleton());$item.append($productList);$.ajax({url:studiare_ajax.ajaxurl,type:'POST',dataType:'json',data:{action:'studiare_actions',nonce:studiare_ajax.nonce,type:'get_products_by_cat',cat_id:subId},success:function(res){$item.removeClass('loading');if(res.success&&res.data.template&&res.data.template.trim()!==''){$productList.removeClass('skeleton-wrapper');$productList.html(res.data.template)}else{$productList.remove();$item.removeClass(RENDERED)}},error:function(){$item.removeClass('loading');$productList.remove();$item.removeClass(RENDERED)}})})}
12$(document).ready(initHeaderCategoryMenu)})(jQuery);window.menuToggle=function(event,submenuId){if(event){event.preventDefault();event.stopPropagation()}
13let dropdown=null;if(submenuId){const submenu=document.getElementById(submenuId);if(!submenu){return!1}
14dropdown=submenu.closest('.studi_rl_with_sub')}else if(event&&event.currentTarget){dropdown=event.currentTarget.closest('.studi_rl_with_sub')}
15if(!dropdown){return!1}
16const isActive=dropdown.classList.contains('active');document.querySelectorAll('.studi_rl_with_sub.active').forEach(function(item){if(item!==dropdown){item.classList.remove('active');const trigger=item.querySelector('.sc-account-trigger, .login-button, .dropdown-toggle');if(trigger){trigger.setAttribute('aria-expanded','false')}}});dropdown.classList.toggle('active',!isActive);const currentTrigger=event&&event.currentTarget?event.currentTarget:dropdown.querySelector('.sc-account-trigger, .login-button, .dropdown-toggle');if(currentTrigger){currentTrigger.setAttribute('aria-expanded',isActive?'false':'true')}
17return!1};document.addEventListener('DOMContentLoaded',function(){document.querySelectorAll('.studi_rl_with_sub').forEach(function(dropdown){const trigger=dropdown.querySelector('.sc-account-trigger, .login-button, .dropdown-toggle');if(!trigger){return}
18if(!trigger.hasAttribute('aria-expanded')){trigger.setAttribute('aria-expanded','false')}
19trigger.addEventListener('click',function(event){if(trigger.hasAttribute('onclick')){return}
20window.menuToggle(event)})});document.addEventListener('click',function(){document.querySelectorAll('.studi_rl_with_sub.active').forEach(function(dropdown){dropdown.classList.remove('active');const trigger=dropdown.querySelector('.sc-account-trigger, .login-button, .dropdown-toggle');if(trigger){trigger.setAttribute('aria-expanded','false')}})})})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.