diff --git a/scripts/pi-hole/js/search.js b/scripts/pi-hole/js/search.js index dae432ec8..9cef84d39 100644 --- a/scripts/pi-hole/js/search.js +++ b/scripts/pi-hole/js/search.js @@ -19,11 +19,13 @@ $(function () { } }); -function eventsource(partial) { +function doSearch() { const ta = $("#output"); // process with the current visible domain input field const q = $("input[id^='domain']:visible").val().trim().toLowerCase(); const N = $("#number").val(); + // Partial matching? + const partial = $("#partialMatch").is(":checked"); if (q.length === 0) { return; @@ -197,17 +199,11 @@ function eventsource(partial) { $("#domain").on("keypress", function (e) { if (e.which === 13) { // Enter was pressed, and the input has focus - eventsource(false); + doSearch(); } }); // Handle search buttons -$("button[id^='btnSearch']").on("click", function () { - var partial = false; - - if (!this.id.match("^btnSearchExact")) { - partial = true; - } - - eventsource(partial); +$("button[id='btnSearch']").on("click", function () { + doSearch(); }); diff --git a/search.lp b/search.lp index cf89465bc..7b5a0892e 100644 --- a/search.lp +++ b/search.lp @@ -17,21 +17,29 @@ mg.include('scripts/pi-hole/lua/header_authenticated.lp','r')
-
- - +
- -
- - +
+
+
+ + +
+
+ +
+
+ + +
+
diff --git a/style/pi-hole.css b/style/pi-hole.css index 4be5c580d..2cf782add 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -562,19 +562,6 @@ td.details-control { } @media screen and (max-width: 991px) { - #domain-search-block { - display: block; - } - #domain { - margin: 5px 0; - } - #domain-search-block .input-group-btn { - display: inline-block; - } - #domain-search-block .input-group-btn button { - margin: 0 5px 0 0; - border-radius: 3px; - } .settings-container { --number-of-columns: 1; } @@ -1478,3 +1465,14 @@ table.dataTable tbody > tr > .selected { overflow-wrap: break-word; inline-size: auto; } + +/* Search page options */ +#domain-limitbox-block { + /* Add margin to match the other component (icheck) height */ + margin: 3px 0; +} +@media (min-width: 992px) { + #domain-limitbox-block { + text-align: right; + } +}