From 2f21777327b88bd5dcfd95a6c2f38e2cbdbdf67f Mon Sep 17 00:00:00 2001 From: Evren Ozkan Date: Tue, 17 Nov 2015 10:50:54 -0500 Subject: [PATCH] Prevents page zooming --- LesionTracker/client/head.html | 4 +- .../worklist/components/tabTitle/tabTitle.js | 43 ++++++++++++++++++- .../worklistResult/worklistResult.styl | 2 + 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/LesionTracker/client/head.html b/LesionTracker/client/head.html index f963a2f00..60600960b 100644 --- a/LesionTracker/client/head.html +++ b/LesionTracker/client/head.html @@ -3,10 +3,10 @@ Lesion Tracker - + - + diff --git a/Packages/worklist/components/tabTitle/tabTitle.js b/Packages/worklist/components/tabTitle/tabTitle.js index 10b4ac3d9..1751db6dd 100644 --- a/Packages/worklist/components/tabTitle/tabTitle.js +++ b/Packages/worklist/components/tabTitle/tabTitle.js @@ -42,5 +42,46 @@ Template.tabTitle.events({ // Remove any stored data related to this tab from the global ViewerData structure delete ViewerData[contentId]; + } -}); \ No newline at end of file +}); + +// Set tab width when a tab is added or removed +function setTabWidth (){ + var allTabTitles = $(".tabTitle"); + var widthTabList = $("#tablist").width(); + var totalTitleWidths = 0; + + var tabCount = 0; + allTabTitles.each( function( index, tabItem ) { + totalTitleWidths += $(tabItem).width(); + tabCount ++; + }); + + if(totalTitleWidths > widthTabList) { + var newTabWidth = widthTabList / tabCount; + allTabTitles.each( function( index, tabItem ) { + $(tabItem).css("width",newTabWidth+"px"); + }); + } else { + var newTabWidth = widthTabList / tabCount; + allTabTitles.each( function( index, tabItem ) { + if (index === 0) { + if(newTabWidth > 95) { + $(tabItem).css("width","95px"); + } else { + $(tabItem).css("width",newTabWidth+"px"); + } + } else { + if(newTabWidth > 130) { + $(tabItem).css("width","130px"); + } else { + $(tabItem).css("width",newTabWidth+"px"); + } + } + + }); + } +} +Template.tabTitle.onRendered(function(){ +}); diff --git a/Packages/worklist/components/worklistResult/worklistResult.styl b/Packages/worklist/components/worklistResult/worklistResult.styl index 63e307146..a323b85f5 100644 --- a/Packages/worklist/components/worklistResult/worklistResult.styl +++ b/Packages/worklist/components/worklistResult/worklistResult.styl @@ -20,3 +20,5 @@ table#tblStudyList &:hover background-color: #009BD2 color: white + +