diff options
author | Andreas Gohr <andi@splitbrain.org> | 2020-03-04 15:10:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 15:10:58 +0100 |
commit | 2cf4f729e4bf39e77023e2e7530ea1148a56886f (patch) | |
tree | cb436ae9481e345bdcebd1d173596ad6d83ea332 | |
parent | ef2fb1a85c73cc857316bf72861ae864d73f2ded (diff) | |
parent | 649a27258dcb1fc02a7f5b450a858644a12f0d0a (diff) | |
download | dokuwiki-2cf4f729e4bf39e77023e2e7530ea1148a56886f.tar.gz dokuwiki-2cf4f729e4bf39e77023e2e7530ea1148a56886f.zip |
Merge pull request #2987 from splitbrain/issue1716
calculate content min-height based on height of aside and pagetool
-rw-r--r-- | lib/tpl/dokuwiki/script.js | 11 |
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 |