OHIF-26: StudyLoadingListener :: minor change (fn.bind)

This commit is contained in:
Leonardo Campos 2017-04-27 19:54:36 -03:00
parent 594a8b1241
commit 8f46e01422

View File

@ -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() {