mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-23 10:13:13 +03:00
Merge pull request #2644 from RationAI/feat/import
Import Openseadragon Dynamically
This commit is contained in:
commit
ffe12888cf
@ -3024,17 +3024,23 @@ function OpenSeadragon( options ){
|
|||||||
|
|
||||||
|
|
||||||
// Universal Module Definition, supports CommonJS, AMD and simple script tag
|
// Universal Module Definition, supports CommonJS, AMD and simple script tag
|
||||||
(function (root, factory) {
|
(function (root, $) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
// expose as amd module
|
// expose as amd module
|
||||||
define([], factory);
|
define([], function () {
|
||||||
|
return $;
|
||||||
|
});
|
||||||
} else if (typeof module === 'object' && module.exports) {
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
// expose as commonjs module
|
// expose as commonjs module
|
||||||
module.exports = factory();
|
module.exports = $;
|
||||||
} else {
|
} else {
|
||||||
// expose as window.OpenSeadragon
|
if (!root) {
|
||||||
root.OpenSeadragon = factory();
|
root = typeof window === 'object' && window;
|
||||||
|
if (!root) {
|
||||||
|
$.console.error("OpenSeadragon must run in browser environment!");
|
||||||
}
|
}
|
||||||
}(this, function () {
|
}
|
||||||
return OpenSeadragon;
|
// expose as window.OpenSeadragon
|
||||||
}));
|
root.OpenSeadragon = $;
|
||||||
|
}
|
||||||
|
}(this, OpenSeadragon));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user