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

Responsive option #39

Open
troyericg opened this issue Apr 4, 2014 · 3 comments
Open

Responsive option #39

troyericg opened this issue Apr 4, 2014 · 3 comments

Comments

@troyericg
Copy link

In addition to the full screen and fixed options, is there a way to offer a viewer option that takes the width of its parent element (calculating an appropriate height from that value)?

We’ve run into an issue on our site now where the Viewer doesn’t fit in with our current responsive grid. I wrote a tiny function to calculate the width/height and pass it to the .load() method, but I’m hoping we can drop this hack at some point.

@jashkenas
Copy link
Member

I think it would make a nice compliment to the current "fixed size", and "full page" options.

Fixed size makes sense when you have a static site layout, or to embed within a larger article.

Full page makes sense when you have a dedicated docviewer page you've designed, with a thin wrapper...

But a "responsive" option would work well for any site that has their articles and interactive pages embedded within a responsive layout. The document viewer would simply create itself at the width of it's parent element, and then set a height proportional to a standard page, based on that width. It would then listen to resize window events, and resize itself using that same math if the parent element's width had changed.

@jheasly
Copy link

jheasly commented Jan 8, 2015

A +1 on this. (Doesn't seem to have been implemented, that I can find.)

@jheasly
Copy link

jheasly commented Jan 9, 2015

... But! Adding responsive: true to the embed options seems to work great! As found here:
https://twitter.com/documentcloud/status/542749083371180033

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