LT-115: Changing the 'more tools' layout and behavior
This commit is contained in:
parent
6be83653f8
commit
55ca29e0cf
@ -203,13 +203,14 @@ Template.toolbarSection.helpers({
|
|||||||
disabled: isToolDisabled
|
disabled: isToolDisabled
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonData.push({
|
// Disabling this on Lesion Tracker
|
||||||
id: 'targetEX',
|
// buttonData.push({
|
||||||
title: 'EX Target',
|
// id: 'targetEX',
|
||||||
classes: 'imageViewerTool toolbarSectionButton',
|
// title: 'EX Target',
|
||||||
svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
// classes: 'imageViewerTool toolbarSectionButton',
|
||||||
disabled: isToolDisabled
|
// svgLink: '/packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-temp',
|
||||||
});
|
// disabled: isToolDisabled
|
||||||
|
// });
|
||||||
|
|
||||||
return buttonData;
|
return buttonData;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
theme('border-bottom', '%s solid $uiBorderColor' % $uiBorderThickness)
|
theme('border-bottom', '%s solid $uiBorderColor' % $uiBorderThickness)
|
||||||
flex: 0 0 auto
|
flex: 0 0 auto
|
||||||
height: $toolbarHeight
|
height: $toolbarHeight
|
||||||
overflow: hidden
|
|
||||||
padding-top: 6px
|
padding-top: 6px
|
||||||
position: relative
|
position: relative
|
||||||
transition(height 300ms ease)
|
transition(height 300ms ease)
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
width: 25%
|
width: 25%
|
||||||
|
|
||||||
input
|
input
|
||||||
theme('background-color', '$boxBackgroundColor')Dark
|
theme('background-color', '$boxBackgroundColor')
|
||||||
min-width: 50px
|
min-width: 50px
|
||||||
width: 40%
|
width: 40%
|
||||||
border: none
|
border: none
|
||||||
|
|||||||
@ -121,7 +121,7 @@ $seriesSpacing = 2px
|
|||||||
width: $switchSize + $seriesSpacing
|
width: $switchSize + $seriesSpacing
|
||||||
|
|
||||||
.seriesItem
|
.seriesItem
|
||||||
theme('background-color', '$boxBackgroundColor')Dark
|
theme('background-color', '$boxBackgroundColor')
|
||||||
border-radius: 3px
|
border-radius: 3px
|
||||||
height: 15px
|
height: 15px
|
||||||
margin: $seriesSpacing
|
margin: $seriesSpacing
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
import { Session } from 'meteor/session';
|
||||||
|
|
||||||
Template.toolbarSectionButton.helpers({
|
Template.toolbarSectionButton.helpers({
|
||||||
activeClass() {
|
activeClass() {
|
||||||
@ -11,9 +13,10 @@ Template.toolbarSectionButton.helpers({
|
|||||||
return 'active';
|
return 'active';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
disableButton() {
|
disableButton() {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
return this.disableFunction && this.disableFunction();
|
return instance.disableFunction && instance.disableFunction();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -37,7 +40,11 @@ Template.toolbarSectionButton.events({
|
|||||||
toolManager.setActiveTool(tool, elements);
|
toolManager.setActiveTool(tool, elements);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
'click .imageViewerCommand'(event, instance) {
|
'click .imageViewerCommand'(event, instance) {
|
||||||
|
// Prevent the event from bubbling to parent tools
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
// Stop here if the tool is disabled
|
// Stop here if the tool is disabled
|
||||||
if ($(event.currentTarget).hasClass('disabled')) {
|
if ($(event.currentTarget).hasClass('disabled')) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -10,12 +10,12 @@
|
|||||||
text-align: center
|
text-align: center
|
||||||
|
|
||||||
&.disabled
|
&.disabled
|
||||||
|
&>.buttonLabel, &>.svgContainer
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
cursor: not-allowed
|
cursor: not-allowed
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
i,
|
&, i
|
||||||
.buttonLabel
|
|
||||||
theme('color', '$textSecondaryColor')
|
theme('color', '$textSecondaryColor')
|
||||||
|
|
||||||
.buttonLabel
|
.buttonLabel
|
||||||
@ -39,7 +39,7 @@
|
|||||||
height: 21px
|
height: 21px
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
.buttonLabel
|
&>.buttonLabel, &>.svgContainer
|
||||||
theme('color', '$hoverColor')
|
theme('color', '$hoverColor')
|
||||||
|
|
||||||
svg
|
svg
|
||||||
@ -50,7 +50,7 @@
|
|||||||
theme('color', '$hoverColor')
|
theme('color', '$hoverColor')
|
||||||
|
|
||||||
&:active, &.active
|
&:active, &.active
|
||||||
.buttonLabel
|
&>.buttonLabel, &>.svgContainer
|
||||||
theme('color', '$activeColor')
|
theme('color', '$activeColor')
|
||||||
|
|
||||||
svg
|
svg
|
||||||
|
|||||||
@ -15,16 +15,14 @@
|
|||||||
<span>More</span>
|
<span>More</span>
|
||||||
<i class="fa fa-caret-down" aria-hidden="true"></i>
|
<i class="fa fa-caret-down" aria-hidden="true"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="toolbarSectionDrawerContainer">
|
<div class="toolbarSectionDrawerContainer">
|
||||||
<!-- TODO: [design] check which group of tools shall be shown -->
|
|
||||||
<div class="toolbarSectionDrawer">
|
<div class="toolbarSectionDrawer">
|
||||||
{{#each toolbarButton in extraToolbarButtons}}
|
{{#each toolbarButton in extraToolbarButtons}}
|
||||||
{{>toolbarSectionButton toolbarButton}}
|
{{>toolbarSectionButton toolbarButton}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -1,8 +1,9 @@
|
|||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
|
||||||
Template.toolbarSectionTools.events({
|
Template.toolbarSectionTools.events({
|
||||||
'click .js-open-more-tools'(event, instance) {
|
'click .js-open-more-tools'(event, instance) {
|
||||||
const $target = $(event.currentTarget);
|
const $target = $(event.currentTarget);
|
||||||
const isActive = $target.hasClass('active');
|
const isActive = $target.hasClass('active');
|
||||||
$target.toggleClass('active', !isActive);
|
$target.toggleClass('active', !isActive);
|
||||||
$target.closest('.toolbarSection').toggleClass('expanded', !isActive);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,30 +1,43 @@
|
|||||||
@import "{design}/app"
|
@import "{design}/app"
|
||||||
|
|
||||||
$distance = 12px
|
$distance = 10px
|
||||||
|
|
||||||
.toolbarSectionTools
|
.toolbarSectionTools
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
|
.toolbarSectionButton.active>.toolbarSectionDrawerContainer
|
||||||
|
opacity: 1
|
||||||
|
transform(translateX(-50%) translateY(0) scale(1))
|
||||||
|
|
||||||
.toolbarSectionDrawerContainer
|
.toolbarSectionDrawerContainer
|
||||||
bottom: - ($toolbarDrawerHeight + $distance)
|
bottom: - $toolbarDrawerHeight
|
||||||
height: $toolbarDrawerHeight
|
height: $toolbarDrawerHeight
|
||||||
left: 0
|
left: 50%
|
||||||
min-width: 100%
|
min-width: 100%
|
||||||
|
opacity: 0
|
||||||
|
padding-top: $distance
|
||||||
position: absolute
|
position: absolute
|
||||||
|
transition(opacity 0.3s ease\, transform 0.3s ease)
|
||||||
|
transform(translateX(-50%) translateY( - ($toolbarDrawerHeight + $distance)) scale(0))
|
||||||
white-space: nowrap
|
white-space: nowrap
|
||||||
|
z-index: 1
|
||||||
|
|
||||||
.toolbarSectionDrawer
|
.toolbarSectionDrawer
|
||||||
theme('background-color', '$uiGrayDarker')
|
theme('background', '$uiGrayDarkest', 0.95)
|
||||||
|
theme('border', '2px solid $uiBorderColor', 0.95)
|
||||||
border-radius: 7px
|
border-radius: 7px
|
||||||
theme('color', '$textPrimaryColor')
|
theme('color', '$textPrimaryColor')
|
||||||
content: ''
|
content: ''
|
||||||
display: block
|
display: block
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
height: $toolbarDrawerHeight - $distance
|
height: $toolbarDrawerHeight
|
||||||
|
padding-top: 6px
|
||||||
text-align: center
|
text-align: center
|
||||||
width: 100%
|
width: 100%
|
||||||
|
|
||||||
#moreTools
|
#moreTools
|
||||||
|
position: relative
|
||||||
|
|
||||||
.buttonLabel i
|
.buttonLabel i
|
||||||
text-align: center
|
text-align: center
|
||||||
transition(all 300ms ease)
|
transition(all 300ms ease)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user