Replacing studyListContextMenu for dropdown
This commit is contained in:
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();
|
||||
|
||||
@@ -6,9 +6,13 @@
|
||||
|
||||
ul.dropdown-menu
|
||||
display: block
|
||||
z-index: 1000
|
||||
transform(scale(0))
|
||||
transition(transform 0.3s ease)
|
||||
|
||||
&.dropdown-menu-left
|
||||
transform-origin(0% 0%)
|
||||
|
||||
&.dropdown-menu-right
|
||||
transform-origin(100% 0%)
|
||||
|
||||
|
||||
Reference in new issue
Block a user