-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require openseadragon if it doesn't exist #23
Conversation
Fixes the `[openseadragon-svg-overlay] requires OpenSeadragon` error when doing this: ``` import OpenSeadragon from 'openseadragon'; import 'svg-overlay'; ``` Borrowed style from https://github.com/usnistgov/OpenSeadragonFiltering/blob/master/openseadragon-filtering.js setting OpenSeadragon object to `$`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just one little nit pick...
openseadragon-svg-overlay.js
Outdated
$ = window.OpenSeadragon; | ||
|
||
if (!$) { | ||
$ = require('openseadragon'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be tabbed out.
@avandecreme FYI :) |
Beautiful, thank you! |
if (!window.OpenSeadragon) { | ||
console.error('[openseadragon-svg-overlay] requires OpenSeadragon'); | ||
return; | ||
$ = window.OpenSeadragon; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just discovered that this line causes a conflict with jQuery because it's missing var
... I've fixed.
Fixes the
[openseadragon-svg-overlay] requires OpenSeadragon
error when doing this:Borrowed style from https://github.com/usnistgov/OpenSeadragonFiltering/blob/master/openseadragon-filtering.js
setting OpenSeadragon object to
$