From 451205e4aa0eb2aa64c0c56c034b3036115be785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 30 Jan 2020 13:07:10 -0500 Subject: [PATCH 1/2] IE11 compatibility --- @plotly/webpack-dash-dynamic-import/package.json | 2 +- @plotly/webpack-dash-dynamic-import/src/index.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/@plotly/webpack-dash-dynamic-import/package.json b/@plotly/webpack-dash-dynamic-import/package.json index 824fd5de02..b2504683b2 100644 --- a/@plotly/webpack-dash-dynamic-import/package.json +++ b/@plotly/webpack-dash-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@plotly/webpack-dash-dynamic-import", - "version": "1.1.4", + "version": "1.1.5", "description": "Webpack Plugin for Dynamic Import in Dash", "repository": { "type": "git", diff --git a/@plotly/webpack-dash-dynamic-import/src/index.js b/@plotly/webpack-dash-dynamic-import/src/index.js index 816c6d278f..1be022ea9a 100644 --- a/@plotly/webpack-dash-dynamic-import/src/index.js +++ b/@plotly/webpack-dash-dynamic-import/src/index.js @@ -20,7 +20,15 @@ var getCurrentScript = function() { if (!script) { /* Shim for IE11 and below */ /* Do not take into account async scripts and inline scripts */ - var scripts = Array.from(document.getElementsByTagName('script')).filter(function(s) { return !s.async && !s.text && !s.textContent; }); + + var doc_scripts = document.getElementsByTagName('script'); + var scripts = []; + + for (var i = 0; i < doc_scripts.length; i++) { + scripts.push(doc_scripts[i]); + } + + scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; }); script = scripts.slice(-1)[0]; } From cf422e8def03f4beb9ad06a1f00d52390bc2f391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 30 Jan 2020 13:13:27 -0500 Subject: [PATCH 2/2] typo --- @plotly/webpack-dash-dynamic-import/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@plotly/webpack-dash-dynamic-import/src/index.js b/@plotly/webpack-dash-dynamic-import/src/index.js index 1be022ea9a..ff7a14dad1 100644 --- a/@plotly/webpack-dash-dynamic-import/src/index.js +++ b/@plotly/webpack-dash-dynamic-import/src/index.js @@ -28,7 +28,7 @@ var getCurrentScript = function() { scripts.push(doc_scripts[i]); } - scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; }); + scripts = scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; }); script = scripts.slice(-1)[0]; }