From 1073631e817c358683b862fe5f2f3bc3ba781dc7 Mon Sep 17 00:00:00 2001 From: Norbert Czirjak Date: Thu, 3 Aug 2023 13:44:20 +0200 Subject: [PATCH] search only d-none by default --- js/smartsearch.js | 10 +++------- templates/arche-smart-search-view.html.twig | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/js/smartsearch.js b/js/smartsearch.js index 9255fd4..a2ab064 100644 --- a/js/smartsearch.js +++ b/js/smartsearch.js @@ -20,6 +20,7 @@ jQuery(function ($) { function countSearchIn() { var count = $('.searchInElement').length; + if(count > 0) {$(".searchOnlyInBtn").removeClass('d-none');} $(".searchOnlyInBtn").html('Search only in ( ' + count + ' ) '); } @@ -39,8 +40,6 @@ jQuery(function ($) { } var element = $('#res' + id).clone(); - console.log('element'); - console.log(element); element.find('div:first-child').html('Remove'); //element.find('div:last-child').children('div').remove(); var btn = element.find('button'); @@ -54,7 +53,6 @@ jQuery(function ($) { }); $(document).delegate(".resetSmartSearch", "click", function (e) { - console.log('clicked'); e.preventDefault(); $('#block-smartsearchblock input[type="text"]').val(''); $('#block-smartsearchblock input[type="search"]').val(''); @@ -65,7 +63,6 @@ jQuery(function ($) { //main search block $(document).delegate(".smartsearch-btn", "click", function (e) { - console.log("search clicked"); $('.arche-smartsearch-page-div').show(); $('#block-mainpagecontent').html('
' + '
' + @@ -313,11 +310,10 @@ jQuery(function ($) { }; param.error = function (xhr, status, error) { - var err = eval("(" + xhr.responseText + ")"); + var err = eval(xhr.responseText); console.log(err.Message); }; - console.log("param: "); - console.log(param); + $.ajax(param); } diff --git a/templates/arche-smart-search-view.html.twig b/templates/arche-smart-search-view.html.twig index 9f46686..130f8b0 100644 --- a/templates/arche-smart-search-view.html.twig +++ b/templates/arche-smart-search-view.html.twig @@ -68,7 +68,7 @@
-->
- +