Skip to content

Commit

Permalink
search only d-none by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Aug 3, 2023
1 parent 4bd26ac commit 1073631
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions js/smartsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ' ) ');
}

Expand All @@ -39,8 +40,6 @@ jQuery(function ($) {
}

var element = $('#res' + id).clone();
console.log('element');
console.log(element);
element.find('div:first-child').html('<a data-removeid="' + id + '" href="#" class="remove_search_only_in">Remove</a>');
//element.find('div:last-child').children('div').remove();
var btn = element.find('button');
Expand All @@ -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('');
Expand All @@ -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('<div class="container">' +
'<div class="row">' +
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion templates/arche-smart-search-view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</div>
-->
<div class="col-12 mt-2">
<button type="button" class="btn btn-info searchOnlyInBtn w-100" onclick="jQuery('#searchIn').toggle();">{{ "Search only in"|trans }}</button>
<button type="button" class="btn btn-info searchOnlyInBtn w-100 d-none" onclick="jQuery('#searchIn').toggle();">{{ "Search only in"|trans }}</button>
<div class="arche_search_toggle_div" id="searchIn">
<div id="searchInInside"></div>
</div>
Expand Down

0 comments on commit 1073631

Please sign in to comment.