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

Show a loading spinner on the image display in geojs in girder #1559

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 1.29.2

### Improvements
- Show a loading spinner on the image display in geojs in girder ([#1559](../../pull/1559))

## 1.29.1

### Improvements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
width auto
margin-left 25px

.image-viewer-loading
position relative
width 0
height 0

.image-viewer
border 1px solid #f0f0f0
width 100%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
option(value=viewer.name) #{viewer.label}
.image-controls
#vue-container
.image-viewer-loading.hidden
span.icon-spin1.animate-spin(title="Loading image")
each viewer in viewers
.image-viewer.hidden(id=viewer.name)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var GeojsImageViewerWidget = ImageViewerWidget.extend({
root = __webpack_public_path__ || root; // eslint-disable-line
} catch (err) { }
root = root.replace(/\/$/, '');
$(this.el).parent().find('.image-viewer-loading').removeClass('hidden');
$.when(
ImageViewerWidget.prototype.initialize.call(this, settings).then(() => {
if (this.metadata.geospatial) {
Expand Down Expand Up @@ -81,6 +82,7 @@ var GeojsImageViewerWidget = ImageViewerWidget.extend({
this.viewer = geo.map(params.map);
params.layer.autoshareRenderer = false;
this._layer = this.viewer.createLayer('osm', params.layer);
this._layer.onIdle(() => $(this.el).parent().find('.image-viewer-loading').addClass('hidden'));
if (this.metadata.frames && this.metadata.frames.length > 1) {
const maxTextures = Math.max(1, Math.min(16, Math.ceil(
this.metadata.frames.length / 1024)));
Expand Down