mirror of
https://github.com/searxng/searxng.git
synced 2025-02-17 02:40:03 +00:00
Merge pull request #929 from dalf/simple-fix-nojs-categories
[fix] simple: categories: use media query detect touch screen
This commit is contained in:
commit
cddc623786
BIN
searx/static/themes/oscar/js/searxng.min.js
vendored
BIN
searx/static/themes/oscar/js/searxng.min.js
vendored
Binary file not shown.
Binary file not shown.
BIN
searx/static/themes/simple/css/searxng-rtl.min.css
vendored
BIN
searx/static/themes/simple/css/searxng-rtl.min.css
vendored
Binary file not shown.
Binary file not shown.
BIN
searx/static/themes/simple/css/searxng.min.css
vendored
BIN
searx/static/themes/simple/css/searxng.min.css
vendored
Binary file not shown.
Binary file not shown.
BIN
searx/static/themes/simple/js/searxng.head.min.js
vendored
BIN
searx/static/themes/simple/js/searxng.head.min.js
vendored
Binary file not shown.
Binary file not shown.
BIN
searx/static/themes/simple/js/searxng.min.js
vendored
BIN
searx/static/themes/simple/js/searxng.min.js
vendored
Binary file not shown.
@ -4,7 +4,6 @@
|
|||||||
* (C) Copyright Contributors to the searx project (2014 - 2021).
|
* (C) Copyright Contributors to the searx project (2014 - 2021).
|
||||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
/* global DocumentTouch:readonly */
|
|
||||||
(function (w, d) {
|
(function (w, d) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -16,7 +15,6 @@
|
|||||||
|
|
||||||
// try to detect touch screen
|
// try to detect touch screen
|
||||||
w.searxng = {
|
w.searxng = {
|
||||||
touch: (("ontouchstart" in w) || w.DocumentTouch && document instanceof DocumentTouch) || false,
|
|
||||||
method: script.getAttribute('data-method'),
|
method: script.getAttribute('data-method'),
|
||||||
autocompleter: script.getAttribute('data-autocompleter') === 'true',
|
autocompleter: script.getAttribute('data-autocompleter') === 'true',
|
||||||
search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true',
|
search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true',
|
||||||
@ -34,7 +32,4 @@
|
|||||||
var hmtlElement = d.getElementsByTagName("html")[0];
|
var hmtlElement = d.getElementsByTagName("html")[0];
|
||||||
hmtlElement.classList.remove('no-js');
|
hmtlElement.classList.remove('no-js');
|
||||||
hmtlElement.classList.add('js');
|
hmtlElement.classList.add('js');
|
||||||
if (w.searxng.touch) {
|
|
||||||
hmtlElement.classList.add('touch');
|
|
||||||
}
|
|
||||||
})(window, document);
|
})(window, document);
|
@ -73,6 +73,20 @@
|
|||||||
|
|
||||||
.search_categories {
|
.search_categories {
|
||||||
grid-area: categories;
|
grid-area: categories;
|
||||||
|
|
||||||
|
.help {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover .help {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
background: var(--color-base-background);
|
||||||
|
padding: 1rem 0.6rem 0.6rem 0;
|
||||||
|
z-index: 1000;
|
||||||
|
width: 100%;
|
||||||
|
left: -0.1rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.search_box {
|
.search_box {
|
||||||
@ -200,26 +214,26 @@
|
|||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
html.touch {
|
@media screen and (max-width: @tablet) and (hover: none) {
|
||||||
#main_index,
|
#main_index,
|
||||||
#main_results {
|
#main_results {
|
||||||
#categories_container {
|
#categories_container {
|
||||||
width: max-content;
|
width: max-content;
|
||||||
|
|
||||||
.category {
|
.category {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#categories {
|
#categories {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.ltr-text-align-left();
|
.ltr-text-align-left();
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,8 +276,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.category {
|
.category {
|
||||||
display: block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: auto;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
} -%}
|
} -%}
|
||||||
<div id="categories" class="search_categories">{{- '' -}}
|
<div id="categories" class="search_categories">{{- '' -}}
|
||||||
<div id="categories_container">
|
<div id="categories_container">
|
||||||
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
|
|
||||||
{%- for category in categories_as_tabs -%}
|
{%- for category in categories_as_tabs -%}
|
||||||
<div class="category"><input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/>
|
<div class="category"><input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/>
|
||||||
<label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">
|
<label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">
|
||||||
@ -22,5 +21,6 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
|
||||||
</div>{{- '' -}}
|
</div>{{- '' -}}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user