From 15ec6bec95dec5c6098ee771dab255ff80aeb32b Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 11 Jul 2021 13:15:13 +0200 Subject: [PATCH] fix #2014 (User menu dropdown in caliblur is tiny and presents scrollbars) Fix display of nonexistent series_index Fix caliblur add-to-shelf --- cps/jinjia.py | 1 + cps/static/css/caliBlur.css | 1 - cps/static/js/caliBlur.js | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cps/jinjia.py b/cps/jinjia.py index 23f727ab..00778335 100644 --- a/cps/jinjia.py +++ b/cps/jinjia.py @@ -113,6 +113,7 @@ def yesno(value, yes, no): @jinjia.app_template_filter('formatfloat') def formatfloat(value, decimals=1): + value = 0 if not value else value return ('{0:.' + str(decimals) + 'g}').format(value) diff --git a/cps/static/css/caliBlur.css b/cps/static/css/caliBlur.css index f479f07f..3b226acb 100644 --- a/cps/static/css/caliBlur.css +++ b/cps/static/css/caliBlur.css @@ -3291,7 +3291,6 @@ div.btn-group[role=group][aria-label="Download, send to Kindle, reading"] .dropd transform-origin: center top; border: 0; left: 0 !important; - max-height: 80%; overflow-y: auto; } diff --git a/cps/static/js/caliBlur.js b/cps/static/js/caliBlur.js index 1a2814fc..ce230730 100644 --- a/cps/static/js/caliBlur.js +++ b/cps/static/js/caliBlur.js @@ -413,7 +413,11 @@ if($("body.advsearch").length > 0) { }); $('#add-to-shelf').height("40px"); function search_dropdownToggle() { - topPos = $("#add-to-shelf").offset().top-20; + if( $("#add-to-shelf").length) { + topPos = $("#add-to-shelf").offset().top - 20; + } else { + topPos = 0 + } if ($('div[aria-label="Add to shelves"]').length > 0) { position = $('div[aria-label="Add to shelves"]').offset().left