diff options
| author | Alexandre Flament <alex@al-f.net> | 2021-03-13 09:29:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-13 09:29:13 +0100 |
| commit | 9292571304376c2c463fb26ee0db89298bb00e6c (patch) | |
| tree | 8a2dba56227f67aa52b091d1674190cd40e1411e /searx/static/themes/oscar/src/js/infobox.js | |
| parent | 22a2e544551e87fb9ea74d2fe07b59bfa0815368 (diff) | |
| parent | cb04d4280642164bddd37e39151bf22799ef3792 (diff) | |
Merge pull request #2346 from dalf/upgrade-oscar
[mod] oscar: upgrade dependencies
Diffstat (limited to 'searx/static/themes/oscar/src/js/infobox.js')
| -rw-r--r-- | searx/static/themes/oscar/src/js/infobox.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/searx/static/themes/oscar/src/js/infobox.js b/searx/static/themes/oscar/src/js/infobox.js new file mode 100644 index 000000000..cb7f1eec5 --- /dev/null +++ b/searx/static/themes/oscar/src/js/infobox.js @@ -0,0 +1,11 @@ +window.addEventListener('load', 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(); + } + }); +}); |