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

Jquery once fix #48

Merged
merged 11 commits into from
May 17, 2023
4 changes: 2 additions & 2 deletions js/openseadragon_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Object.keys(settings.openseadragon).forEach(function(osdViewerId) {
// Use custom element #id if set.
base = '#' + osdViewerId;
$(base, context).once('openSeadragonViewer').each(function () {
once('openSeadragonViewer', $(base, context)).forEach(function () {
adam-vessey marked this conversation as resolved.
Show resolved Hide resolved
Drupal.openSeadragonViewer[base] = new Drupal.openSeadragonViewer(base, settings.openseadragon[osdViewerId]);
});
});
Expand Down Expand Up @@ -122,4 +122,4 @@
}

};
})(jQuery);
})(once);
3 changes: 1 addition & 2 deletions openseadragon.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ init:
component:
css/openseadragon.css: {}
dependencies:
- core/jquery
- core/jquery.once
- core/once
- core/drupal
- core/drupalSettings
- openseadragon/openseadragon
Expand Down