Replacing SVG polyfill to fix event issues
This commit is contained in:
1 parent
233d12c481
commit
b6b3a443a2
9 files changed
+24
-30
No files matched your search
@@ -1,19 +1,6 @@
|
||||
import { $ } from 'meteor/jquery';
|
||||
import { absoluteUrl } from './lib/absoluteUrl';
|
||||
import writeScript from './lib/writeScript';
|
||||
|
||||
/* jshint -W060 */
|
||||
// Check if browser is IE and add the polyfill scripts
|
||||
if (navigator && /MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
|
||||
const writeScript = fileName => {
|
||||
const src = absoluteUrl(`/packages/ohif_polyfill/public/js/${fileName}`);
|
||||
document.write(`<script src="${src}"><\/script>`);
|
||||
};
|
||||
|
||||
writeScript('svgxuse.min.js');
|
||||
writeScript('typedarray.min.js');
|
||||
|
||||
window.addEventListener('click', event => {
|
||||
if (!window.SVGElementInstance || !(event.target instanceof SVGElementInstance)) return;
|
||||
$(event.target.correspondingUseElement).trigger('click');
|
||||
}, true);
|
||||
}
|
||||
Reference in new issue
Block a user