Merge pull request #9407 from Jerryby/wordpress

LAW-7726
This commit is contained in:
bivis
2024-04-11 14:34:07 +03:00
committed by GitHub
2 changed files with 6 additions and 6 deletions

View File

@@ -73,7 +73,7 @@ window.addEventListener('DOMContentLoaded', function(){
catalogSearchBtn.addEventListener('click', function(){ catalogSearchBtn.addEventListener('click', function(){
let searchText = catalogSearchInput.value; let searchText = catalogSearchInput.value;
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText; top.location = 'https://app.livecarta.com/catalog?tab=materials&search=' + searchText;
}) })
catalogSearchClear.addEventListener('click', function(){ catalogSearchClear.addEventListener('click', function(){
@@ -83,7 +83,7 @@ window.addEventListener('DOMContentLoaded', function(){
catalogSearchInput.addEventListener('keyup', function(e){ catalogSearchInput.addEventListener('keyup', function(e){
if (e.keyCode === 13) { if (e.keyCode === 13) {
let searchText = catalogSearchInput.value; let searchText = catalogSearchInput.value;
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText; top.location = 'https://app.livecarta.com/catalog?tab=materials&search=' + searchText;
} }
}) })
} }
@@ -91,7 +91,7 @@ window.addEventListener('DOMContentLoaded', function(){
document.addEventListener('click', function(e){ document.addEventListener('click', function(e){
if (e.target.classList && e.target.closest('.catalogSearchBtn')) { if (e.target.classList && e.target.closest('.catalogSearchBtn')) {
let searchText = e.target.closest('.input-flex').querySelector('.catalogSearchInput').value; let searchText = e.target.closest('.input-flex').querySelector('.catalogSearchInput').value;
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText; top.location = 'https://app.livecarta.com/catalog?tab=materials&search=' + searchText;
} }
if (e.target.classList && e.target.closest('.catalogSearchClear')) { if (e.target.classList && e.target.closest('.catalogSearchClear')) {
e.target.closest('.input-flex').querySelector('.catalogSearchInput').value = ''; e.target.closest('.input-flex').querySelector('.catalogSearchInput').value = '';
@@ -101,7 +101,7 @@ window.addEventListener('DOMContentLoaded', function(){
document.addEventListener('keyup', function(e){ document.addEventListener('keyup', function(e){
if (e.keyCode === 13 && e.target.classList.contains('catalogSearchInput')) { if (e.keyCode === 13 && e.target.classList.contains('catalogSearchInput')) {
let searchText = e.target.value; let searchText = e.target.value;
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText; top.location = 'https://app.livecarta.com/catalog?tab=materials&search=' + searchText;
} }
}) })

View File

@@ -401,7 +401,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
if (event.target?.closest('#header-search-btn')) { if (event.target?.closest('#header-search-btn')) {
let searchData = document.getElementById('header-search').value.trim(); let searchData = document.getElementById('header-search').value.trim();
top.location = appUrl + '/catalog?tab=books-tab&search=' + searchData; top.location = appUrl + '/catalog?tab=materials&search=' + searchData;
} }
if (!event.target.closest('.mobile-menu.open')) { if (!event.target.closest('.mobile-menu.open')) {
@@ -412,7 +412,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
document.querySelector('#header-search').addEventListener('keyup', function(e){ document.querySelector('#header-search').addEventListener('keyup', function(e){
if (e.key === "Enter") { if (e.key === "Enter") {
let searchData = e.target.value.trim(); let searchData = e.target.value.trim();
top.location = appUrl + '/catalog?tab=books-tab&search=' + searchData; top.location = appUrl + '/catalog?tab=materials&search=' + searchData;
} }
}) })
}); });