2017-09-05 20:53:20 -03:00
|
|
|
/* jshint -W060 */
|
|
|
|
|
import absoluteUrl from './absoluteUrl';
|
|
|
|
|
|
2017-10-27 23:47:30 -02:00
|
|
|
export default function(fileName, callback) {
|
|
|
|
|
const script = document.createElement('script');
|
|
|
|
|
script.src = absoluteUrl(`/packages/ohif_polyfill/public/js/${fileName}`);
|
|
|
|
|
script.onload = () => {
|
|
|
|
|
if (typeof callback === 'function') {
|
|
|
|
|
callback(script);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
document.body.appendChild(script);
|
2017-09-05 20:53:20 -03:00
|
|
|
}
|