aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/modules/_vj_collection.sass15
-rw-r--r--app/views/referential_vehicle_journeys/_consolidated.html.slim14
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')