diff --git a/Packages/ohif-design/styles/common/global.styl b/Packages/ohif-design/styles/common/global.styl index a7f7e043b..aaa4fece8 100644 --- a/Packages/ohif-design/styles/common/global.styl +++ b/Packages/ohif-design/styles/common/global.styl @@ -21,6 +21,10 @@ body ol margin: 0 padding-left: 1em +// This is needed for IE11 because svgxuse doesn't allow the browser to capture mouse events on SVG +svg, use + pointer-events: none + input::-ms-clear display: none diff --git a/Packages/ohif-polyfill/client/ie.js b/Packages/ohif-polyfill/client/ie.js index 2a908dd63..bec22d1fd 100644 --- a/Packages/ohif-polyfill/client/ie.js +++ b/Packages/ohif-polyfill/client/ie.js @@ -7,7 +7,7 @@ if (navigator && /MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { Meteor.startup(() => { $(window).on('load', () => { // Fix SVG+USE issues by calling the SVG polyfill - writeScript('svg4everybody.min.js', () => window.svg4everybody()); + writeScript('svgxuse.min.js'); }); }); } diff --git a/Packages/ohif-polyfill/package.js b/Packages/ohif-polyfill/package.js index a7483215d..ab843b5e9 100644 --- a/Packages/ohif-polyfill/package.js +++ b/Packages/ohif-polyfill/package.js @@ -12,7 +12,7 @@ Package.onUse(function(api) { api.use('jquery'); // Assets to be imported dynamically - api.addAssets('public/js/svg4everybody.min.js', 'client'); + api.addAssets('public/js/svgxuse.min.js', 'client'); // Client imports api.addFiles('client/index.js', 'client'); diff --git a/Packages/ohif-polyfill/public/js/svg4everybody.min.js b/Packages/ohif-polyfill/public/js/svg4everybody.min.js deleted file mode 100644 index da3f6d8ca..000000000 --- a/Packages/ohif-polyfill/public/js/svg4everybody.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.svg4everybody=b()}):"object"==typeof module&&module.exports?module.exports=b():a.svg4everybody=b()}(this,function(){function a(a,b,c){if(c){var d=document.createDocumentFragment(),e=!b.hasAttribute("viewBox")&&c.getAttribute("viewBox");e&&b.setAttribute("viewBox",e);for(var f=c.cloneNode(!0);f.childNodes.length;)d.appendChild(f.firstChild);a.appendChild(d)}}function b(b){b.onreadystatechange=function(){if(4===b.readyState){var c=b._cachedDocument;c||(c=b._cachedDocument=document.implementation.createHTMLDocument(""),c.body.innerHTML=b.responseText,b._cachedTarget={}),b._embeds.splice(0).map(function(d){var e=b._cachedTarget[d.id];e||(e=b._cachedTarget[d.id]=c.getElementById(d.id)),a(d.parent,d.svg,e)})}},b.onreadystatechange()}function c(c){function e(){for(var c=0;c0)&&n(e,67)}var f,g=Object(c),h=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,i=/\bAppleWebKit\/(\d+)\b/,j=/\bEdge\/12\.(\d+)\b/,k=/\bEdge\/.(\d+)\b/,l=window.top!==window.self;f="polyfill"in g?g.polyfill:h.test(navigator.userAgent)||(navigator.userAgent.match(j)||[])[1]<10547||(navigator.userAgent.match(i)||[])[1]<537||k.test(navigator.userAgent)&&l;var m={},n=window.requestAnimationFrame||setTimeout,o=document.getElementsByTagName("use"),p=0;f&&e()}function d(a){for(var b=a;"svg"!==b.nodeName.toLowerCase()&&(b=b.parentNode););return b}return c}); diff --git a/Packages/ohif-polyfill/public/js/svgxuse.min.js b/Packages/ohif-polyfill/public/js/svgxuse.min.js new file mode 100644 index 000000000..ce2099f32 --- /dev/null +++ b/Packages/ohif-polyfill/public/js/svgxuse.min.js @@ -0,0 +1,12 @@ +/*! + * @copyright Copyright (c) 2017 IcoMoon.io + * @license Licensed under MIT license + * See https://github.com/Keyamoon/svgxuse + * @version 1.2.6 + */ +(function(){if("undefined"!==typeof window&&window.addEventListener){var e=Object.create(null),l,d=function(){clearTimeout(l);l=setTimeout(n,100)},m=function(){},t=function(){window.addEventListener("resize",d,!1);window.addEventListener("orientationchange",d,!1);if(window.MutationObserver){var k=new MutationObserver(d);k.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0});m=function(){try{k.disconnect(),window.removeEventListener("resize",d,!1),window.removeEventListener("orientationchange", +d,!1)}catch(v){}}}else document.documentElement.addEventListener("DOMSubtreeModified",d,!1),m=function(){document.documentElement.removeEventListener("DOMSubtreeModified",d,!1);window.removeEventListener("resize",d,!1);window.removeEventListener("orientationchange",d,!1)}},u=function(k){function e(a){if(void 0!==a.protocol)var c=a;else c=document.createElement("a"),c.href=a;return c.protocol.replace(/:/g,"")+c.host}if(window.XMLHttpRequest){var d=new XMLHttpRequest;var m=e(location);k=e(k);d=void 0=== +d.withCredentials&&""!==k&&k!==m?XDomainRequest||void 0:XMLHttpRequest}return d};var n=function(){function d(){--q;0===q&&(m(),t())}function l(a){return function(){!0!==e[a.base]&&(a.useEl.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+a.hash),a.useEl.hasAttribute("href")&&a.useEl.setAttribute("href","#"+a.hash))}}function p(a){return function(){var c=document.body,b=document.createElement("x");a.onload=null;b.innerHTML=a.responseText;if(b=b.getElementsByTagName("svg")[0])b.setAttribute("aria-hidden", +"true"),b.style.position="absolute",b.style.width=0,b.style.height=0,b.style.overflow="hidden",c.insertBefore(b,c.firstChild);d()}}function n(a){return function(){a.onerror=null;a.ontimeout=null;d()}}var a,c,q=0;m();var f=document.getElementsByTagName("use");for(c=0;c