summaryrefslogtreecommitdiff
path: root/searx/static/themes/oscar/js/searx.js
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2020-08-10 12:15:05 +0200
committerGitHub <noreply@github.com>2020-08-10 12:15:05 +0200
commit43df251f3d4f70b94fcbe37542e12af77bc10f8a (patch)
tree00a66a0a88f3aa1e2adbb136c69984e635ada191 /searx/static/themes/oscar/js/searx.js
parentf3bfc19a557ef121d370033de6325df2ca835dcd (diff)
parent0601f2bb481758ed8e0e68f96a976063d9b229db (diff)
Merge pull request #2131 from MarcAbonce/infobox_style
Make infobox shorter by default and add an expand toggle
Diffstat (limited to 'searx/static/themes/oscar/js/searx.js')
-rw-r--r--searx/static/themes/oscar/js/searx.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js
index 040d57bb1..543c7775c 100644
--- a/searx/static/themes/oscar/js/searx.js
+++ b/searx/static/themes/oscar/js/searx.js
@@ -204,6 +204,17 @@ $(document).ready(function(){
$(a.target).parent().attr("aria-selected", "true");
});
});
+;$(document).ready(function() {
+ // Hide infobox toggle if shrunk size already fits all content.
+ $('.infobox').each(function() {
+ var infobox_body = $(this).find('.infobox_body');
+ var total_height = infobox_body.prop('scrollHeight') + infobox_body.find('img.infobox_part').height();
+ var max_height = infobox_body.css('max-height').replace('px', '');
+ if (total_height <= max_height) {
+ $(this).find('.infobox_toggle').hide();
+ }
+ });
+});
;/**
* searx is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by