Uses a css-only approach and set the transformation origin

pull/3506/head
Henriette Dinger 9 years ago
parent 788efee374
commit 27d2a39e56
  1. 9
      app/assets/stylesheets/content/_tables.sass
  2. 16
      frontend/app/ui_components/interactive-table-directive.js

@ -90,12 +90,17 @@ table
text-transform: uppercase text-transform: uppercase
font-weight: bold font-weight: bold
max-width: 50px max-width: 50px
min-width: 50px
position: relative
span span
white-space: nowrap white-space: nowrap
transform: rotate(270deg) transform: rotate(270deg)
display: block position: absolute
text-align: right top: -40px
right: 50%
transform-origin: right center
margin-top: 8px
thead thead
.workflow-table--header .workflow-table--header

@ -56,10 +56,6 @@ module.exports = function($timeout, $window){
'.generic-table--footer-background'); '.generic-table--footer-background');
} }
function getTurnedHeader(){
return getInnerContainer().find('.workflow-table--turned-header-text');
}
function getHeadersFooters() { function getHeadersFooters() {
return element.find( return element.find(
'.generic-table--sort-header-outer,' + '.generic-table--sort-header-outer,' +
@ -71,8 +67,7 @@ module.exports = function($timeout, $window){
function setTableContainerWidths() { function setTableContainerWidths() {
// adjust overall containers // adjust overall containers
var tableWidth = getTable().width(), var tableWidth = getTable().width(),
scrollBarWidth = 16, scrollBarWidth = 16;
turnedHeaderMargin;
// account for a possible scrollbar // account for a possible scrollbar
if (tableWidth > document.documentElement.clientWidth - scrollBarWidth) { if (tableWidth > document.documentElement.clientWidth - scrollBarWidth) {
@ -94,15 +89,6 @@ module.exports = function($timeout, $window){
getBackgrounds().css('width', '100%'); getBackgrounds().css('width', '100%');
} }
} }
// HACK: Important for workflow table
// The turned Header needs to be as high as the table to correctly align it at the end.
// Because of the rotation the width needs to be set instead of height.
// Because of that the text gets misaligned and needs a margin, to remove the space on the left side.
// So the calculation: height/2 - font-size
turnedHeaderMargin = -(getInnerContainer().height()/2 - parseInt(getTurnedHeader().css('font-size'), 10));
getTurnedHeader().width(getInnerContainer().height())
.css('margin-left', turnedHeaderMargin);
} }
function setHeaderFooterWidths() { function setHeaderFooterWidths() {

Loading…
Cancel
Save