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

Add support for specifying parent container #33

Closed
wants to merge 1 commit into from

Conversation

jonjaques
Copy link
Contributor

I've updated this PR to include a few tests and squash it down to 1 commit. Closes #14.

There was one hiccup I did not anticipate originally: changing the bar to be absolutely positioned within its container (by default the body), prevents it from being visible when the document is scrolled.

My solution was to set the position to fixed only when the parent is the body.

@cryptiklemur
Copy link

Throwing a big +1 to this one, would be super handy

@k-k
Copy link

k-k commented Sep 4, 2013

When I first saw NProgress I said "Neat!", second thing I said was "wonder if I can change the containing element..."

+1 on this PR

@5im0n
Copy link

5im0n commented Sep 8, 2013

+1

@scarfacedeb
Copy link

+1.
I was thinking along the lines with this one.

@zwily
Copy link

zwily commented Dec 22, 2013

👍

@joscha
Copy link

joscha commented Jan 15, 2014

👍
@rstacruz can this be merged please?

@klyrr
Copy link

klyrr commented Jan 20, 2014

+1

@silvermanners
Copy link

+100 for this feature.

@brickgale
Copy link

👍 pls add this

@joscha
Copy link

joscha commented May 12, 2014

@rstacruz any way we could get this in? Pretty please...

@chriserik
Copy link

+1

@rstacruz
Copy link
Owner

Looking at this now. I think I'd like to see this refined a little further to be merge-ready:

  • This PR isn't mergeable anymore since the migration away from jQuery, so it'll have to be implemented again.
  • If the parent container isn't specified (!parent), it should default to 'body', rather than the parent option being "body" by default. This allows us to...
  • ...keep position: fixed when no parent is specified. If the absolute is the default, makes the progress bar not visible when the page is scrolled down.
  • the #nprogress element should have a custom class if a parent is specified. This allows us to do something like #nprogress.np-custom-parent .bar { position: absolute; } without making position: absolute the default.

@jonjaques
Copy link
Contributor Author

Updated PR here: #86

@jonjaques jonjaques closed this Jun 21, 2014
@rstacruz
Copy link
Owner

This has now been implemented. Thanks @jonjaques!

Documented here: https://github.com/rstacruz/nprogress/blob/master/Readme.md#parent

@rstacruz rstacruz mentioned this pull request Jun 21, 2014
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

Successfully merging this pull request may close these issues.