Fix the issues with customized store and retrieve functions for hot keys and window/level presets
This commit is contained in:
1 parent
6b8613017e
commit
51d6a64c45
2 files changed
+10
-2
No files matched your search
@@ -33,7 +33,7 @@ export class HotkeysManager {
|
|||||||
const storageKey = `hotkeysDefinitions.${contextName}`;
|
const storageKey = `hotkeysDefinitions.${contextName}`;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (this.storeFunction) {
|
if (this.storeFunction) {
|
||||||
this.storeFunction(contextName, definitions).then(resolve).catch(reject);
|
this.storeFunction.call(this, storageKey, definitions).then(resolve).catch(reject);
|
||||||
} else if (Meteor.userId()) {
|
} else if (Meteor.userId()) {
|
||||||
OHIF.user.setData(storageKey, definitions).then(resolve).catch(reject);
|
OHIF.user.setData(storageKey, definitions).then(resolve).catch(reject);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -50,6 +50,14 @@ class WindowLevelPresetsManager {
|
|||||||
this.changeObserver = new Tracker.Dependency();
|
this.changeObserver = new Tracker.Dependency();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setRetrieveFunction(retrieveFunction) {
|
||||||
|
this.retrieveFunction = retrieveFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
setStoreFunction(storeFunction) {
|
||||||
|
this.storeFunction = storeFunction;
|
||||||
|
}
|
||||||
|
|
||||||
updateElementWLPresetData(element) {
|
updateElementWLPresetData(element) {
|
||||||
const wlPresetData = cornerstone.getElementData(element, 'wlPreset');
|
const wlPresetData = cornerstone.getElementData(element, 'wlPreset');
|
||||||
const enabledElement = cornerstone.getEnabledElement(element);
|
const enabledElement = cornerstone.getEnabledElement(element);
|
||||||
@@ -123,7 +131,7 @@ class WindowLevelPresetsManager {
|
|||||||
store(wlPresets) {
|
store(wlPresets) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (this.storeFunction) {
|
if (this.storeFunction) {
|
||||||
this.storeFunction.call(this, wlPresets).then(resolve).catch(reject);
|
this.storeFunction.call(this, WL_STORAGE_KEY, wlPresets).then(resolve).catch(reject);
|
||||||
} else if (Meteor.userId()) {
|
} else if (Meteor.userId()) {
|
||||||
OHIF.user.setData(WL_STORAGE_KEY, wlPresets).then(resolve).catch(reject);
|
OHIF.user.setData(WL_STORAGE_KEY, wlPresets).then(resolve).catch(reject);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user