Remove old templates, hookup trial options button

This commit is contained in:
Erik Ziegler 2016-06-08 12:32:06 +02:00
parent 7fca7e3129
commit 4e6f46f876
8 changed files with 3 additions and 206 deletions

View File

@ -1,18 +0,0 @@
<template name="hidingPanel">
<div class="hidingPanel {{#if isPinned}}pinned{{/if}}">
<div class="iconContainer">
{{#unless isPinned}}
<i class="arrowIcon fa fa-angle-double-right"></i>
{{/unless}}
<button class="btn btn-sm btn-primary btnPin {{#if isPinned}}active{{/if}}">
<i class="fa fa-thumb-tack"></i>
</button>
</div>
<div class="hidingPanelContent">
{{> studyDateList}}
<div class="studyBrowserContainer">
{{> studyBrowser}}
</div>
</div>
</div>
</template>

View File

@ -1,120 +0,0 @@
function pinPanel() {
var hidingPanel = $('.hidingPanel');
hidingPanel.css({
width: '122px'
});
hidingPanel.find('.hidingPanelContent').css({
transform: 'translate(130px)'
});
// Calculate newWidth of viewportAndLesionTable
var viewerWidth = $('#viewer').width();
var newWidth = 100 - 122 / viewerWidth * 100;
$('#viewportAndLesionTable').css('width', newWidth + '%');
}
function unpinPanel() {
// Calculate newWidth of viewportAndLesionTable
$('#viewportAndLesionTable').css('width', '99%');
}
Template.hidingPanel.events({
'mouseover div.hidingPanel': function(e, template) {
var isPinned = template.isPinned.get();
if (isPinned) {
return;
}
var hidingPanel = $(e.currentTarget);
hidingPanel.css({
width: '122px'
});
// Set panel as open
template.panelOpen.set(true);
// Rotate Arrow Icon
$('.arrowIcon').addClass('fa-flip-horizontal');
// Set panel content opacity
//hidingPanel.find('.hidingPanelContent').css('opacity', '1');
hidingPanel.find('.hidingPanelContent').css({
transform: 'translate(130px)'
});
},
'mouseout div.hidingPanel': function(e, template) {
var isPinned = template.isPinned.get();
if (isPinned) {
return;
}
var hidingPanel = $(e.currentTarget);
hidingPanel.css({
width: '1%'
});
// Set panel as closed
template.panelOpen.set(false);
// Rotate Arrow Icon
$('.arrowIcon').removeClass('fa-flip-horizontal');
// Set panel content opacity
//hidingPanel.find('.hidingPanelContent').css('opacity', '0');
hidingPanel.find('.hidingPanelContent').css({
transform: 'translate(-130px)'
});
},
'click button.btnPin': function(e, template) {
var isPinned = template.isPinned.get();
isPinned = !isPinned;
template.isPinned.set(isPinned);
// Set isPanelPinned of ViewerData
var contentId = template.data.contentId;
ViewerData[contentId].isPanelPinned = isPinned;
Session.set('ViewerData', ViewerData);
if (isPinned) {
pinPanel();
} else {
unpinPanel();
}
resizeViewportElements();
}
});
Template.hidingPanel.helpers({
isPinned: function() {
return Template.instance().isPinned.get();
}
});
Template.hidingPanel.onRendered(function() {
var contentId = this.data.contentId;
var isPanelPinned = ViewerData[contentId].isPanelPinned;
if (isPanelPinned) {
pinPanel();
}
});
Template.hidingPanel.onCreated(function() {
this.panelOpen = new ReactiveVar(false);
var contentId = this.data.contentId;
var isPanelPinned = ViewerData[contentId].isPanelPinned;
if (!isPanelPinned) {
isPanelPinned = false;
}
this.isPinned = new ReactiveVar(isPanelPinned);
});

View File

@ -1,46 +0,0 @@
.hidingPanel
width: 1%
height: 100%
position: absolute
left: 0
top: 70px
bottom: 0
z-index: 10
background-color: black
border: 1px solid #666
&.pinned
border: 1px solid transparent
.iconContainer
width: 100%
height: 35px
overflow: hidden
.arrowIcon
color: white
margin: 0px 3px
font-size: 15pt
line-height: 35px
.btnPin
float: right
margin: 3px
outline: none
.hidingPanelContent
position: absolute
left: -130px
width: 100%
height: 100%
margin: 1px auto
.studyBrowserContainer
height: calc(100% - 150px)
.hidingPanel, .arrowIcon
-o-transition: all 0.3s ease-out
-ms-transition: all 0.3s ease-out
-moz-transition: all 0.3s ease-out
-webkit-transition: all 0.3s ease-out
transition: all 0.3s ease-out

View File

@ -1,9 +0,0 @@
<template name="optionsButton">
<a href="#"
data-toggle="modal"
data-target="#optionsModal"
title="Trial Options">
<i class="fa fa-cog fa-lg"></i>
Trial Options
</a>
</template>

View File

@ -1,5 +1,5 @@
<template name="optionsModal">
<div class="modal" id="optionsModal" tabindex="-1" role="dialog" aria-labelledby="optionsModalLabel">
<div class="modal fade" id="optionsModal" tabindex="-1" role="dialog" aria-labelledby="optionsModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">

View File

@ -65,7 +65,7 @@
HUD
</div>
</div>
<div class="pull-right toolbarSectionButton">
<div class="pull-right toolbarSectionButton" data-toggle="modal" data-target="#optionsModal">
<div class="svgContainer">
<svg>
<use xlink:href="/packages/lesiontracker/assets/icons.svg#icon-trial-info"></use>

View File

@ -13,10 +13,6 @@
</a>
</li>
{{else}}
<!--TODO: Move this elsewhere in the Worklist? -->
<li>
{{>optionsButton }}
</li>
<li>
<a href="/audit" id="audit">
<i class="fa fa-list-ul"></i> View Audit Log

View File

@ -107,13 +107,7 @@ Package.onUse(function(api) {
api.addFiles('client/components/hipaaLogPage/hipaaLogPage.styl', 'client');
api.addFiles('client/components/hipaaLogPage/hipaaLogPage.js', 'client');
api.addFiles('client/components/hidingPanel/hidingPanel.html', 'client');
api.addFiles('client/components/hidingPanel/hidingPanel.styl', 'client');
api.addFiles('client/components/hidingPanel/hidingPanel.js', 'client');
api.addFiles('client/components/optionsButton/optionsButton.html', 'client');
api.addFiles('client/components/optionsModal/optionsModal.html', 'client');
api.addFiles('client/components/optionsModal/optionsModal.styl', 'client');
api.addFiles('client/components/optionsModal/optionsModal.js', 'client');