Skip to content

Commit

Permalink
fix: emit event on image load progress (#1735)
Browse files Browse the repository at this point in the history
Co-authored-by: scouser <[email protected]>
  • Loading branch information
minimal-scouser and scouser authored Jan 6, 2025
1 parent afbab70 commit db8314b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/dicomImageLoader/src/imageLoader/internal/xhrRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ function xhrRequest(
percentComplete = Math.round((loaded / total) * 100);
}

const eventData = {
url,
imageId,
loaded,
total,
percentComplete,
};

triggerEvent(eventTarget, 'cornerstoneimageloadprogress', eventData);

// Action
if (options.onprogress) {
options.onprogress(oProgress, params);
Expand Down

0 comments on commit db8314b

Please sign in to comment.