From 8af73dc438caa82f02c68869c2f6202c6d69a06d Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Sat, 28 Oct 2017 07:45:53 -0200 Subject: [PATCH] Preventing svg polyfill from interefering on frames rendering --- Packages/ohif-polyfill/client/ie.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Packages/ohif-polyfill/client/ie.js b/Packages/ohif-polyfill/client/ie.js index d6b0909ef..e46a51bd2 100644 --- a/Packages/ohif-polyfill/client/ie.js +++ b/Packages/ohif-polyfill/client/ie.js @@ -1,12 +1,16 @@ import { Meteor } from 'meteor/meteor'; +import { $ } from 'meteor/jquery'; import writeScript from './lib/writeScript'; -Meteor.startup(() => { - // Check if browser is IE and add the polyfill scripts - if (navigator && /MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { +// Check if browser is IE and add the polyfill scripts +if (navigator && /MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { + Meteor.startup(() => { + // This is needed before window loading because it's used to parse DICOM images data writeScript('typedarray.min.js'); - // Fix SVG+USE issues by calling the SVG polyfill - writeScript('svg4everybody.min.js', () => window.svg4everybody()); - } -}); + $(window).on('load', () => { + // Fix SVG+USE issues by calling the SVG polyfill + writeScript('svg4everybody.min.js', () => window.svg4everybody()); + }); + }); +}