From b4bdc45a6b9d3c50c8b621ee1b168f3e94a74e2a Mon Sep 17 00:00:00 2001 From: Jay Lindquist Date: Mon, 23 Oct 2017 17:35:15 -0500 Subject: [PATCH] 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 --- superset/assets/package.json | 3 ++- superset/assets/visualizations/markup.js | 11 +++++++---- superset/data/__init__.py | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/superset/assets/package.json b/superset/assets/package.json index 83c87fd9e7..634ba70532 100644 --- a/superset/assets/package.json +++ b/superset/assets/package.json @@ -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" diff --git a/superset/assets/visualizations/markup.js b/superset/assets/visualizations/markup.js index 27647daab0..739e4510d9 100644 --- a/superset/assets/visualizations/markup.js +++ b/superset/assets/visualizations/markup.js @@ -1,4 +1,4 @@ -const $ = require('jquery'); +const srcdoc = require('srcdoc-polyfill'); require('./markup.css'); @@ -23,9 +23,12 @@ function markupWidget(slice, payload) { `); - $('#' + iframeId)[0].srcdoc = html; + sandbox="allow-same-origin allow-scripts allow-top-navigation allow-popups"> + + `); + + const iframe = document.getElementById(iframeId); + srcdoc.set(iframe, html); } module.exports = markupWidget; diff --git a/superset/data/__init__.py b/superset/data/__init__.py index 2671a3f5a4..39151062f2 100644 --- a/superset/data/__init__.py +++ b/superset/data/__init__.py @@ -688,7 +688,7 @@ def load_birth_names():

Birth Names Dashboard

The source dataset came from - [here] + [here]