Same for sandboxed html on the book details page

This commit is contained in:
Kovid Goyal 2017-07-18 11:50:01 +05:30
parent 26f61556d1
commit 0f18fdefa5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -110,7 +110,8 @@ def adjust_all_iframes(ev):
window.addEventListener('resize', debounce(adjust_all_iframes, 250)) window.addEventListener('resize', debounce(adjust_all_iframes, 250))
def adjusting_sandboxed_html(html): def adjusting_sandboxed_html(html):
ans = sandboxed_html(html, 'html, body { overflow: hidden }', 'allow-same-origin') css = 'html, body {{ overflow: hidden; color: {} }}'.format(get_color('window-foreground'))
ans = sandboxed_html(html, css, 'allow-same-origin')
ans.addEventListener('load', def(ev): adjust_iframe_height(ev.target);) ans.addEventListener('load', def(ev): adjust_iframe_height(ev.target);)
ans.style.height = '50vh' ans.style.height = '50vh'
ans.dataset.last_window_width = '0' ans.dataset.last_window_width = '0'