From 8316ed020e2bcd2e9b28d0827ae626a9d927eed4 Mon Sep 17 00:00:00 2001 From: Zog Date: Mon, 7 May 2018 09:06:55 +0200 Subject: Refs #6923; :lipstick: --- app/assets/stylesheets/modules/_vj_collection.sass | 15 +++++++++++++-- .../referential_vehicle_journeys/_consolidated.html.slim | 14 +++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/modules/_vj_collection.sass b/app/assets/stylesheets/modules/_vj_collection.sass index da61cc5e5..b68b191d8 100644 --- a/app/assets/stylesheets/modules/_vj_collection.sass +++ b/app/assets/stylesheets/modules/_vj_collection.sass @@ -234,14 +234,18 @@ .route background: #F9F9F9 & > .head - padding: 15px &.highlighted .pull-right, span.fa color: $highlighted !important a + padding: 15px color: black font-size: 1.2em text-transform: capitalize + display: block + text-decoration: none + &:hover + background-color: #F0F0F0 .fa color: $red transition: transform 0.1s @@ -251,7 +255,14 @@ font-size: 0.9em text-transform: lowercase .vehicle-journeys - margin-bottom: 40px + display: block + overflow: hidden + transition: height 0.5s, margin-bottom 0.5s + margin-bottom: 0px + & > * + display: inline-block + &.open + margin-bottom: 40px .highlighted background-color: lighten($highlighted, 20%) !important diff --git a/app/views/referential_vehicle_journeys/_consolidated.html.slim b/app/views/referential_vehicle_journeys/_consolidated.html.slim index b79a61dfb..e2de526bc 100644 --- a/app/views/referential_vehicle_journeys/_consolidated.html.slim +++ b/app/views/referential_vehicle_journeys/_consolidated.html.slim @@ -15,7 +15,19 @@ coffee: $(e.target).toggleClass 'active' $(e.target).parents('.table').find('.detailed-purchase-windows').toggleClass 'hidden' + $('.route').find('.vehicle-journeys').each (i, e)-> + $e = $(e) + $e.removeClass 'hidden' + e.setAttribute 'data-original-height', $e.height() + $e.height 0 + $('a.toggle-route').click (e)-> e.preventDefault() $(e.currentTarget).toggleClass 'active' - $(e.currentTarget).parents('.route').find('.vehicle-journeys').toggleClass 'hidden' + tab = $(e.currentTarget).parents('.route').find('.vehicle-journeys') + if tab.hasClass 'open' + tab.removeClass 'open' + tab.height 0 + else + tab.addClass 'open' + tab.height tab.attr('data-original-height') -- cgit v1.2.3