luv-assets 1.2.15 → 1.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/p/header.min.js +1 -1
- package/package.json +1 -1
package/dist/js/p/header.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function renderSearchHistory(){const $list=$("#search-history-items-js");const history=SearchHistory.getKeywords();if(history.length===0){$("#search-history-js").addClass("d-none");return}$("#search-history-js").removeClass("d-none");$list.empty();history.forEach(keyword=>{const $item=$(`<li><a href="${searchUrl}?q=${encodeURIComponent(keyword)}" class="badge bg-light text-dark text-decoration-none">${keyword}</a></li>`);$list.append($item)})}$(document).ready(function(){$(".luv-nav-item").hover(function(){$(this).addClass("active");$(this).find(".nav-link").addClass("active")},function(){$(this).removeClass("active");$(this).find(".nav-link").removeClass("active")});const $qInput=$("#keywords");if($qInput.length>0){const $searchSuggestions=$("#search-suggestions-js");const $searchForm=$("#search-form-js");$qInput.on("focus",function(){SearchHistory.pullFromServer(pullSearchHistoryUrl);renderSearchHistory();$searchSuggestions.removeClass("d-none");$qInput.attr("aria-expanded","true")});$searchForm.on("submit",function(){const q=$input.val().trim();if(!q){e.preventDefault();$input.focus();return false}SearchHistory.save(q,saveSearchHistoryUrl)});$(document).on("click",function(e){if(!$searchForm[0].contains(e.target)){$searchSuggestions.addClass("d-none");$qInput.attr("aria-expanded","false")}});$qInput.on("keydown",function(e){if(e.key==="Escape"){$searchSuggestions.addClass("d-none");$qInput.attr("aria-expanded","false");$qInput.blur()}});$("#removeSearchDialog .btn-primary").click(function(){SearchHistory.clear(removeHistoryUrl);location.reload()});$searchSuggestions.on("click","a",function(e){const q=new URL(this.href).searchParams.get("q");if(q)SearchHistory.save(q,saveSearchHistoryUrl)})}$("
|
|
1
|
+
function renderSearchHistory(){const $list=$("#search-history-items-js");const history=SearchHistory.getKeywords();if(history.length===0){$("#search-history-js").addClass("d-none");return}$("#search-history-js").removeClass("d-none");$list.empty();history.forEach(keyword=>{const $item=$(`<li><a href="${searchUrl}?q=${encodeURIComponent(keyword)}" class="badge bg-light text-dark text-decoration-none">${keyword}</a></li>`);$list.append($item)})}$(document).ready(function(){$(".luv-nav-item").hover(function(){$(this).addClass("active");$(this).find(".nav-link").addClass("active")},function(){$(this).removeClass("active");$(this).find(".nav-link").removeClass("active")});const $qInput=$("#keywords");if($qInput.length>0){const $searchSuggestions=$("#search-suggestions-js");const $searchForm=$("#search-form-js");$qInput.on("focus",function(){SearchHistory.pullFromServer(pullSearchHistoryUrl);renderSearchHistory();$searchSuggestions.removeClass("d-none");$qInput.attr("aria-expanded","true")});$searchForm.on("submit",function(){const q=$input.val().trim();if(!q){e.preventDefault();$input.focus();return false}SearchHistory.save(q,saveSearchHistoryUrl)});$(document).on("click",function(e){if(!$searchForm[0].contains(e.target)){$searchSuggestions.addClass("d-none");$qInput.attr("aria-expanded","false")}});$qInput.on("keydown",function(e){if(e.key==="Escape"){$searchSuggestions.addClass("d-none");$qInput.attr("aria-expanded","false");$qInput.blur()}});$("#removeSearchDialog .btn-primary").click(function(){SearchHistory.clear(removeHistoryUrl);location.reload()});$searchSuggestions.on("click","a",function(e){const q=new URL(this.href).searchParams.get("q");if(q)SearchHistory.save(q,saveSearchHistoryUrl)})}$("#lang-currency-submit-js").on("click",function(){if($(this).prop("disabled")){return}$(this).prop("disabled",true).text(settingTranslations.waitingText);var selectedStore=$("#current-lang-select-js").val();var selectedCurrency=$("#current-currency-select-js").val();$.ajax({url:settingUrl+"?currency="+selectedCurrency,async:false});var currentUrl=window.location.href;var redirectUrl=currentUrl.replace("://"+currentStore,"://"+selectedStore);redirectUrl=redirectUrl.split("#")[0];window.location.href=redirectUrl})});
|