Skip to content

Closes #13688: added scroll to top button to div.footer via doc/_temp… #13689

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

Merged

Conversation

shawnheide
Copy link
Contributor

Added scroll to top feature to documentation div.footer using Sphinx template

@jreback
Copy link
Contributor

jreback commented Jul 17, 2016

I don't think this is the right template

@shawnheide
Copy link
Contributor Author

I understand you suggested to add to the theme's main template, but adding it to the div.footer seems like a better approach since it's closer to the end of the page. Any other reason you think it's not the right template? Did you try building the docs and it didn't work?

@jreback
Copy link
Contributor

jreback commented Jul 17, 2016

well did the docs build?

@shawnheide
Copy link
Contributor Author

shawnheide commented Jul 17, 2016

Yes, they build just fine as far as I can tell and the code is inserted just above the </body>.

Here's the bottom of my build for index.html

    <style type="text/css">
    .scrollToTop {
        text-align: center;
        font-weight: bold;
        position: fixed;
        bottom: 60px;
        right: 40px;
        display: none;
    }
    </style>
    <a href="#" class="scrollToTop">Scroll To Top</a>
    <script type="text/javascript">
    $(document).ready(function() {
        //Check to see if the window is top if not then display button
        $(window).scroll(function() {
            if ($(this).scrollTop() > 200) {
                $('.scrollToTop').fadeIn();
            } else {
                $('.scrollToTop').fadeOut();
            }
        });

        //Click event to scroll to top
        $('.scrollToTop').click(function() {
            $('html, body').animate({
                scrollTop: 0
            }, 500);
            return false;
        });
    });
    </script>
</body>

screen shot 2016-07-17 at 12 36 40 pm

@sinhrks sinhrks added the Docs label Jul 17, 2016
@shawnheide
Copy link
Contributor Author

@jreback, just curious if you had any other feedback on this

@jorisvandenbossche
Copy link
Member

@shawnheide Can you explain again why this cannot be added to the doc/source/themes/nature_with_gtoc/static/layout.html ? Can't you add the footer there as well?

@jorisvandenbossche
Copy link
Member

But to be clear, the enhancement itself is really nice!

@shawnheide shawnheide force-pushed the feature/scoll-to-top branch from 0d614b2 to 19ba380 Compare July 20, 2016 16:32
@shawnheide
Copy link
Contributor Author

@jorisvandenbossche No reason it couldn't be added. In all honesty I just got a little burnt out on Sphinx and didn't look into last week. I moved it to the theme as you and Jeff requested and changed the commit. Thanks for following up on this.

@codecov-io
Copy link

Current coverage is 84.53%

Merging #13689 into master will not change coverage

@@             master     #13689   diff @@
==========================================
  Files           141        141          
  Lines         51145      51145          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43233      43233          
  Misses         7912       7912          
  Partials          0          0          

Powered by Codecov. Last updated by 8acfad3...19ba380

@jorisvandenbossche jorisvandenbossche merged commit b23ec91 into pandas-dev:master Jul 23, 2016
@jorisvandenbossche
Copy link
Member

@shawnheide Thanks!

@jorisvandenbossche jorisvandenbossche added this to the 0.19.0 milestone Jul 23, 2016
@shawnheide shawnheide deleted the feature/scoll-to-top branch July 25, 2016 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOCS/ENHANCEMENT: Scroll to top button in documentation
5 participants