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

Bottom of the Repo cut off when opening first file in Chrome with clear cache #28

Open
boozelclark opened this issue Sep 15, 2013 · 2 comments

Comments

@boozelclark
Copy link

If I have an empty html document with nothing but a div to hold the repo when I first open a file it seems like the div calculates it height before all the GitHub like formatting has been applied so the bottom of the file is cut-off. After the first one has loaded all the rest of the files in the repo work fine because their formatting is applied before they are shown. I suspect it has something to do with the fonts not being downloaded the first time.

@malcomio
Copy link

If the element that you call the repo function on has the class of repo then the height will not be calculated correctly.

@SMJSGaming
Copy link

SMJSGaming commented Sep 4, 2019

I personally tested this because I got the same problem, an easy fix is to force height auto when you open a file (not in the tree)

here's a simple jquery I made to fix this, be aware, this checks if there's any pre tags which exists, so if you got more than one pre in the file make it not just check for 1 but for the ammount you got on default +1

var fixedfirst = false;
setInterval(function check() {
    if (!fixedfirst) {
        if ($("pre").length) {
            $(".repo").height('auto');
            fixedfirst = true;
        }
    }
}, 200);

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

No branches or pull requests

3 participants