Add support for IE 11 for markup slices (#3702)

* Add srcdoc-polyfill tosupport Internet Explorer iframes in markup slices. Add allow-top-navigation and allow-popups to support links within iframes

* Remove jquery from markup.js
This commit is contained in:
Jay Lindquist 2017-10-23 17:35:15 -05:00 committed by Maxime Beauchemin
parent fa07b8d51b
commit b4bdc45a6b
3 changed files with 10 additions and 6 deletions

View File

@ -49,10 +49,10 @@
"classnames": "^2.2.5",
"d3": "^3.5.17",
"d3-cloud": "^1.2.1",
"d3-hierarchy": "^1.1.5",
"d3-sankey": "^0.4.2",
"d3-svg-legend": "^1.x",
"d3-tip": "^0.6.7",
"d3-hierarchy": "^1.1.5",
"datamaps": "^0.5.8",
"datatables.net-bs": "^1.10.15",
"distributions": "^1.0.0",
@ -93,6 +93,7 @@
"redux-thunk": "^2.1.0",
"shortid": "^2.2.6",
"sprintf-js": "^1.1.1",
"srcdoc-polyfill": "^1.0.0",
"supercluster": "https://github.com/georgeke/supercluster/tarball/ac3492737e7ce98e07af679623aad452373bbc40",
"urijs": "^1.18.10",
"viewport-mercator-project": "^2.1.0"

View File

@ -1,4 +1,4 @@
const $ = require('jquery');
const srcdoc = require('srcdoc-polyfill');
require('./markup.css');
@ -23,9 +23,12 @@ function markupWidget(slice, payload) {
<iframe id="${iframeId}"
frameborder="0"
height="${slice.height()}"
sandbox="allow-scripts">
</iframe>`);
$('#' + iframeId)[0].srcdoc = html;
sandbox="allow-same-origin allow-scripts allow-top-navigation allow-popups">
</iframe>
`);
const iframe = document.getElementById(iframeId);
srcdoc.set(iframe, html);
}
module.exports = markupWidget;

View File

@ -688,7 +688,7 @@ def load_birth_names():
<h1>Birth Names Dashboard</h1>
<p>
The source dataset came from
<a href="https://github.com/hadley/babynames">[here]</a>
<a href="https://github.com/hadley/babynames" target="_blank">[here]</a>
</p>
<img src="/static/assets/images/babytux.jpg">
</div>