Style when there are thumbnails available

TODO: Once we have the user-space, we show or not .has-thumbnail
This commit is contained in:
2016-11-03 17:51:20 +01:00
parent a047dbac48
commit 6aa8db2dff
4 changed files with 23 additions and 4 deletions

View File

@@ -93,3 +93,4 @@ $screen-md-max: $screen-lg-min - 1
$sidebar-width: 50px
$shots-list-thumbnail-width: 100px
$shots-list-thumbnail-height: 60px

View File

@@ -96,7 +96,7 @@
.progress
margin-bottom: 0
h4
h3
margin-top: 0
font-weight: normal

View File

@@ -32,6 +32,10 @@
.table-body
display: table-row-group
&.has-thumbnails
.table-cell a,
.table-cell a.task-link
height: $shots-list-thumbnail-height
.table-row
position: relative
@@ -45,6 +49,7 @@
@include status-color-property(background-color, ' .shot-status', '')
.table-cell
text-align: center
border-left: thin solid transparent
@@ -65,6 +70,9 @@
padding: 5px 10px
color: $color-text-dark-primary
span
margin: auto 0
&.task-type
position: relative
height: 100%

View File

@@ -16,7 +16,7 @@
.table-row
.table-cell.shot-status
.table-cell.shot-thumbnail
span.collapser(title="Collapse thumbnails") Thumbnail
span.collapser.thumbnails(title="Collapse thumbnails") Thumbnail
.table-cell.shot-name
span.collapser(title="Collapse name column") Name
| {% for task_type in task_types %}
@@ -24,7 +24,7 @@
span.collapser(title="Collapse {{ task_type or 'Other' }} column") {{ task_type or 'other' }}
| {% endfor %}
.table-body
.table-body.has-thumbnails
| {% for shot in shots %}
.table-row(
id="shot-{{ shot._id }}",
@@ -97,16 +97,26 @@ script.
/* We need to find every cell matching the same classes */
same_cells = '.' + $(this).parent().attr('class').split(' ').join('.');
if ($(this).hasClass('thumbnails')){
$('.table-body').removeClass('has-thumbnails');
}
$(same_cells).hide();
/* Add the spacer which we later click to expand */
$('<div class="table-cell-spacer" title="Expand ' + $(this).text() + '"></div>').insertAfter(same_cells);
$('<div class="table-cell-spacer ' + $(this).text() + '" title="Expand ' + $(this).text() + '"></div>').insertAfter(same_cells);
});
$('body').on('click', '.table-cell-spacer', function(){
if ($(this).prev().hasClass('shot-thumbnail')){
$('.table-body').addClass('has-thumbnails');
}
/* We need to find every cell matching the same classes */
same_cells = '.' + $(this).prev().attr('class').split(' ').join('.');
$(same_cells).show();
$(same_cells).next().remove();
});
$('.table-body .table-cell').mouseenter(function(){