From 8f46e01422fdafaf62e5e41e594708410a600580 Mon Sep 17 00:00:00 2001 From: Leonardo Campos Date: Thu, 27 Apr 2017 19:54:36 -0300 Subject: [PATCH] OHIF-26: StudyLoadingListener :: minor change (fn.bind) --- .../client/lib/studyLoadingListener.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Packages/ohif-viewerbase/client/lib/studyLoadingListener.js b/Packages/ohif-viewerbase/client/lib/studyLoadingListener.js index 25f1022ed..15d286187 100644 --- a/Packages/ohif-viewerbase/client/lib/studyLoadingListener.js +++ b/Packages/ohif-viewerbase/client/lib/studyLoadingListener.js @@ -52,12 +52,11 @@ class DICOMFileLoadingListener extends BaseLoadingListener { startListening() { const imageLoadProgressEventName = this._getImageLoadProgressEventName(); + const imageLoadProgressEventHandle = this._imageLoadProgressEventHandle.bind(this); this.stopListening(); - $(cornerstone).on(imageLoadProgressEventName, (e, eventData) => { - this._imageLoadProgressEventHandle(e, eventData); - }); + $(cornerstone).on(imageLoadProgressEventName, imageLoadProgressEventHandle); } stopListening() { @@ -127,16 +126,13 @@ class StackLoadingListener extends BaseLoadingListener { startListening() { const imageLoadedEventName = this._getImageLoadedEventName(); const imageCachePromiseRemovedEventName = this._getImageCachePromiseRemoveEventName(); + const imageLoadedEventHandle = this._imageLoadedEventHandle.bind(this); + const imageCachePromiseRemovedEventHandle = this._imageCachePromiseRemovedEventHandle.bind(this); this.stopListening(); - $(cornerstone).on(imageLoadedEventName, (e, eventData) => { - this._imageLoadedEventHandle(e, eventData); - }); - - $(cornerstone).on(imageCachePromiseRemovedEventName, (e, eventData) => { - this._imageCachePromiseRemovedEventHandle(e, eventData); - }); + $(cornerstone).on(imageLoadedEventName, imageLoadedEventHandle); + $(cornerstone).on(imageCachePromiseRemovedEventName, imageCachePromiseRemovedEventHandle); } stopListening() {