Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'min-height' of '#dokuwiki__content div.page' set incorrectly. #1649

Open
Sergii-Babych opened this issue Jul 31, 2016 · 2 comments
Open

'min-height' of '#dokuwiki__content div.page' set incorrectly. #1649

Sergii-Babych opened this issue Jul 31, 2016 · 2 comments

Comments

@Sergii-Babych
Copy link

Sergii-Babych commented Jul 31, 2016

Bug show: http://wiki.babitch.com/bug/sidebar
Bug workaround: http://wiki.babitch.com/bug/workaround
Problem in file: $DokuWikiDIR/lib/tpl/dokuwiki# kuwiki/script.js
In this fragment:

// increase sidebar length to match content (desktop mode only)
var $sidebar = jQuery('.desktop #dokuwiki__aside');
if($sidebar.length) {
    var $content = jQuery('#dokuwiki__content div.page');
    $content.css('min-height', $sidebar.height());
}

It increase content's frame length, not sidebar.
And in this time several elements do not have actual height value.
As result content's frame height have incorrect value (too large).

Workaround: Do this after browser page rendering done.

jQuery(document).ready(function() {

  var bugfix = function() {
     var $sidebar = jQuery('.desktop #dokuwiki__aside');
     var $content = jQuery('#dokuwiki__content div.page');
     $content.css('min-height', $sidebar.height());
  };

  setTimeout(bugfix,1);

});
@selfthinker
Copy link
Collaborator

The original code's intention was to make the sidebar and content areas the same height to make it more visually pleasing. Your fix would only fix that the content area is too high but it introduces a new issue that the content area doesn't grow after the collapsed elements are expanded in the sidebar.

I would say this is an edge case as it only happens when you have collapsed elements in the sidebar. Or do you know of other cases?

@Sergii-Babych
Copy link
Author

Sergii-Babych commented Aug 8, 2016

But as a result the height of the content area is a much greater than the height of the sidebar.

It is not a fix. It is workaround exclusively for my case on my site.

No! I don't know of other cases.

And in my case there is workaround.

But there is a bug and I just reported about it.
In this particular case, the program would not work as it would like.
I proposed a solution. And that's not the fix. This is an example of how I solved the problem in my case specifically.

As a fix, I would suggest to remove this piece of code at all.

// increase sidebar length to match content (desktop mode only)
var $sidebar = jQuery('.desktop #dokuwiki__aside');
if($sidebar.length) {
    var $content = jQuery('#dokuwiki__content div.page');
    $content.css('min-height', $sidebar.height());
}

But if you still want to leave it, you should do it at least with a delay time.
Something like this:

// increase sidebar length to match content (desktop mode only)
setTimeout(function(){
    var $sidebar = jQuery('.desktop #dokuwiki__aside');
    if($sidebar.length) {
        var $content = jQuery('#dokuwiki__content div.page');
        $content.css('min-height', $sidebar.height());
    }
},1);

But of course you decide what to do :)
Thanks!
DokuWiki is a very good software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants