From f33702541cdaa66d4ad18d4a7f285fbf8c80649a Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Fri, 2 Jun 2017 10:28:20 -0300 Subject: [PATCH] Fixing issues with action mixin --- .../ohif-core/client/components/base/mixins/action.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages/ohif-core/client/components/base/mixins/action.js b/Packages/ohif-core/client/components/base/mixins/action.js index 96e656226..0679a6701 100644 --- a/Packages/ohif-core/client/components/base/mixins/action.js +++ b/Packages/ohif-core/client/components/base/mixins/action.js @@ -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);