Fixing SVG click event issues on IE11
This commit is contained in:
parent
ae6044e3a1
commit
9b41bc932f
@ -1,3 +1,5 @@
|
||||
import { $ } from 'meteor/jquery';
|
||||
|
||||
/* jshint -W060 */
|
||||
// Check if browser is IE and add the polyfill scripts
|
||||
if (navigator && /MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
|
||||
@ -8,4 +10,9 @@ if (navigator && /MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
|
||||
|
||||
writeScript('svgxuse.min.js');
|
||||
writeScript('typedarray.js');
|
||||
|
||||
window.addEventListener('click', event => {
|
||||
if (!window.SVGElementInstance || !(event.target instanceof SVGElementInstance)) return;
|
||||
$(event.target.correspondingUseElement).trigger('click');
|
||||
}, true);
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ Package.onUse(function(api) {
|
||||
|
||||
// Meteor packages
|
||||
api.use('ecmascript');
|
||||
api.use('jquery');
|
||||
|
||||
// Assets to be imported dynamically
|
||||
api.addAssets('public/js/svgxuse.min.js', 'client');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user