Fixing issues with action mixin

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2017-06-14 09:19:49 +02:00
1 parent 56c3d0f1dd
commit f33702541c
1 file changed
+4 -4
@@ -39,12 +39,12 @@ OHIF.mixins.action = new OHIF.Mixin({
// Get the current component's API
const api = component.getApi();
if (!api || !action || typeof api[action] !== 'function') {
// Stop here if no API or action was defined
return true;
} else if (typeof action === 'function') {
if (typeof action === 'function') {
// Call the action if it's a function
component.actionResult = action.call(event.currentTarget, params);
} else if (!api || !action || typeof api[action] !== 'function') {
// Stop here if no API or action was defined
return true;
} else {
// Call the defined action function
component.actionResult = api[action].call(event.currentTarget, params);