aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPhy <git@phy25.com>2020-02-22 15:28:25 -0500
committerPhy <git@phy25.com>2020-02-22 15:28:25 -0500
commit649a27258dcb1fc02a7f5b450a858644a12f0d0a (patch)
treeb318a5d44e041b2746a4af9e7a9c3e3959bc165a
parent6d7e4f82694362b31bd8f7d81b79f9bc2935ab06 (diff)
downloaddokuwiki-649a27258dcb1fc02a7f5b450a858644a12f0d0a.tar.gz
dokuwiki-649a27258dcb1fc02a7f5b450a858644a12f0d0a.zip
calculate content min-height based on height of aside and pagetool
Fixes #1716. Before it will only set min-height based on aside height. I added a current height check before applying min-height, because there might be a min-height CSS on .page in stylesheet, and I want to respect that and only apply if necessery.
-rw-r--r--lib/tpl/dokuwiki/script.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/tpl/dokuwiki/script.js b/lib/tpl/dokuwiki/script.js
index 5a68e8b9c..88dae9023 100644
--- a/lib/tpl/dokuwiki/script.js
+++ b/lib/tpl/dokuwiki/script.js
@@ -71,10 +71,15 @@ jQuery(function(){
);
// increase sidebar length to match content (desktop mode only)
- var $sidebar = jQuery('.desktop #dokuwiki__aside');
- if($sidebar.length) {
+ var sidebar_height = jQuery('.desktop #dokuwiki__aside').height();
+ var pagetool_height = jQuery('.desktop #dokuwiki__pagetools ul:first').height();
+ // pagetools div has no height; ul has a height
+ var content_min = Math.max(sidebar_height || 0, pagetool_height || 0);
+
+ var content_height = jQuery('#dokuwiki__content div.page').height();
+ if(content_min && content_min > content_height) {
var $content = jQuery('#dokuwiki__content div.page');
- $content.css('min-height', $sidebar.height());
+ $content.css('min-height', content_min);
}
// blur when clicked