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

StaticHTMLRenderer fix height #144

Open
ThijsBroersen opened this issue Jun 28, 2018 · 0 comments
Open

StaticHTMLRenderer fix height #144

ThijsBroersen opened this issue Jun 28, 2018 · 0 comments

Comments

@ThijsBroersen
Copy link

Regarding the work-around to fix the height of an iframe:
I experienced issues in jupyter-lab with the height so I started debugging and wrote a custom method to get my html. The new iframe used an onload function which is just an attribute (so no issues with sandbox allow-this-that bla bla.
Could you please also fix the ConfigDSL, it currently returns a partial function...

val renderer = StaticHTMLRenderer(builder.config(background = "white")(builder).toJson)
val html = s"""
        | <iframe 
        | style="border: none; width: 100%" 
        | onload='(function(e){setTimeout(function() { e.style.height = e.contentDocument.firstElementChild.scrollHeight + "px"}, 200)})(this);' 
        | srcdoc="${xml.Utility.escape(renderer.pageHTML())}"></iframe>
        """.stripMargin
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

1 participant