Skip to content
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

Merged
merged 2 commits into from
Mar 14, 2018

Conversation

lk-jeffpeck
Copy link
Contributor

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 $

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 `$`
Copy link
Member

@iangilman iangilman left a 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...

$ = window.OpenSeadragon;

if (!$) {
$ = require('openseadragon');
Copy link
Member

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.

@iangilman
Copy link
Member

@avandecreme FYI :)

@iangilman
Copy link
Member

Beautiful, thank you!

@iangilman iangilman merged commit bea5a94 into openseadragon:master Mar 14, 2018
if (!window.OpenSeadragon) {
console.error('[openseadragon-svg-overlay] requires OpenSeadragon');
return;
$ = window.OpenSeadragon;
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants