Replacing studyListContextMenu for dropdown

This commit is contained in:
Bruno Alves de Faria committed 2017-03-21 10:16:47 -03:00
1 parent 4daf7d8bf8
commit 485f82f64c
22 files changed
+250 -325

No files matched your search

@@ -20,11 +20,12 @@ OHIF.mixins.action = new OHIF.Mixin({
event.preventDefault();
const component = instance.component;
// Extract action, params and disabled state
const { action, params, disabled } = instance.data;
// Extract action, disabled state and params
const { action } = instance.data;
const params = instance.data.params ? instance.data.params : event;
// Stop here if the component is disabled
if (disabled) return;
if (component.$element.hasClass('disabled')) return;
// Get the current component's API
const api = component.getApi();
@@ -42,7 +42,8 @@ OHIF.mixins.dropdown = new OHIF.Mixin({
// Close the dropdown resolving or rejecting the promise
instance.close = (isResolve, result) => {
const method = instance.data[isResolve ? 'promiseResolve' : 'promiseReject'];
method(result);
const param = result instanceof Promise ? null : result;
method(param);
};
// Stop here and destroy the view if no items was given
@@ -52,7 +53,7 @@ OHIF.mixins.dropdown = new OHIF.Mixin({
dropdown.oncontextmenu = () => false;
const cssBefore = { 'z-index': 10000 };
const cssBefore = {};
if (event) {
cssBefore.position = 'fixed';
$dropdownMenu.bounded();