mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-22 17:53:13 +03:00
feat: ability to attach OSD to window reference if available
This commit is contained in:
parent
c06e719198
commit
ad943e5472
@ -3024,17 +3024,23 @@ function OpenSeadragon( options ){
|
||||
|
||||
|
||||
// Universal Module Definition, supports CommonJS, AMD and simple script tag
|
||||
(function (root, factory) {
|
||||
(function (root, $) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// expose as amd module
|
||||
define([], factory);
|
||||
define([], function () {
|
||||
return OpenSeadragon;
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// expose as commonjs module
|
||||
module.exports = factory();
|
||||
module.exports = $;
|
||||
} else {
|
||||
if (!root) {
|
||||
root = typeof window === 'object' && window;
|
||||
if (!root) {
|
||||
$.console.error("OpenSeadragon must run in browser environment!");
|
||||
}
|
||||
}
|
||||
// expose as window.OpenSeadragon
|
||||
root.OpenSeadragon = factory();
|
||||
root.OpenSeadragon = $;
|
||||
}
|
||||
}(this, function () {
|
||||
return OpenSeadragon;
|
||||
}));
|
||||
}(this, OpenSeadragon));
|
||||
|
Loading…
x
Reference in New Issue
Block a user