Merge pull request #8229 from Jerryby/wordpress

scripts fix
This commit is contained in:
bivis
2023-05-16 11:52:04 +03:00
committed by GitHub

View File

@@ -53,25 +53,27 @@ window.addEventListener('DOMContentLoaded', function(){
// catalog
const catalogSearchBtn = document.getElementById('catalogSearchBtn');
const catalogSearchInput = document.getElementById('catalogSearchInput');
const catalogSearchClear = document.getElementById('catalogSearchClear');
if (document.getElementById('catalogSearchBtn')) {
const catalogSearchBtn = document.getElementById('catalogSearchBtn');
const catalogSearchInput = document.getElementById('catalogSearchInput');
const catalogSearchClear = document.getElementById('catalogSearchClear');
catalogSearchBtn.addEventListener('click', function(){
let searchText = catalogSearchInput.value;
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText;
})
catalogSearchClear.addEventListener('click', function(){
catalogSearchInput.value = '';
})
catalogSearchInput.addEventListener('keyup', function(e){
if (e.keyCode === 13) {
catalogSearchBtn.addEventListener('click', function(){
let searchText = catalogSearchInput.value;
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText;
}
})
})
catalogSearchClear.addEventListener('click', function(){
catalogSearchInput.value = '';
})
catalogSearchInput.addEventListener('keyup', function(e){
if (e.keyCode === 13) {
let searchText = catalogSearchInput.value;
top.location = 'https://app.livecarta.com/catalog?tab=books-tab&search=' + searchText;
}
})
}
// sliders