Begin shrinckable subheader implementation.

This commit is contained in:
Mateus Machado Luna 2018-05-18 16:10:56 -03:00
parent 65b8089f15
commit 56565ee7cb
6 changed files with 52 additions and 13 deletions

View File

@ -290,8 +290,7 @@ export default {
.selection-control { .selection-control {
padding: 6px 14px 0px 14px; padding: 6px 0px 0px 18px;
position: relative;
background: white; background: white;
height: 40px; height: 40px;

View File

@ -110,7 +110,7 @@ export default {
} }
}, },
props: { props: {
id: Number id: Number,
}, },
watch: { watch: {
'$route' (to) { '$route' (to) {
@ -217,6 +217,26 @@ export default {
left: 0; left: 0;
right: 0; right: 0;
z-index: 9; z-index: 9;
transition: padding 0.3s, height 0.3s;
&.is-shrink {
height: $header-height;
max-height: $header-height;
padding-top: 12px;
padding-bottom: 12px;
h1 { margin-bottom: 4px; }
li a {
line-height: 20px;
br { display: none; }
.menu-text {
visibility:
hidden; opacity: 0;
font-size: 0;
line-height: 0;
}
}
}
h1 { h1 {
font-size: 18px; font-size: 18px;
@ -228,6 +248,8 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
-webkit-transition: margin-bottom 0.2s linear; /* Safari */
transition: margin-bottom 0.2s linear;
} }
.breadcrumbs { .breadcrumbs {
@ -254,8 +276,6 @@ export default {
min-width: 75px; min-width: 75px;
line-height: 1.5em; line-height: 1.5em;
border-radius: 0px; border-radius: 0px;
-webkit-transition: padding 0.3s linear; /* Safari */
transition: padding 0.3s linear;
position: relative; position: relative;
overflow: inherit; overflow: inherit;
} }
@ -287,8 +307,8 @@ export default {
font-size: 14px; font-size: 14px;
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
transition: opacity 0.3s linear, visibility 0.3s linear; transition: opacity 0.5s linear, visibility 0.5s linear;
-webkit-transition: opacity 0.3s linear, visibility 0.3s linear; -webkit-transition: opacity 0.5s linear, visibility 0.5s linear;
} }
} }

View File

@ -380,7 +380,8 @@
} }
.tabs { .tabs {
padding-top: $page-small-top-padding; padding-top: 20px;
margin-bottom: 20px;
padding-left: $page-side-padding; padding-left: $page-side-padding;
padding-right: $page-side-padding; padding-right: $page-side-padding;
} }

View File

@ -1,8 +1,12 @@
<template> <template>
<div class="columns is-fullheight"> <div class="columns is-fullheight">
<section class="column is-secondary-content"> <section class="column is-secondary-content">
<tainacan-subheader :id="collectionId"/> <tainacan-subheader
<router-view :class="{ 'is-shrink': hasScrolled }"
:id="collectionId"/>
<router-view
id="collecion-page-container"
ref="collection-page-container"
:collection-id="collectionId" :collection-id="collectionId"
class="page-container page-container-small"/> class="page-container page-container-small"/>
</section> </section>
@ -16,15 +20,25 @@ export default {
name: 'CollectionPage', name: 'CollectionPage',
data(){ data(){
return { return {
collectionId: Number collectionId: Number,
hasScrolled: false
} }
}, },
components: { components: {
TainacanSubheader TainacanSubheader
}, },
methods:{
handleScroll() {
this.hasScrolled = (this.$refs['collection-page-container'].$el.scrollTop > 5);
console.log(this.$refs['collection-page-container'].$el.scrollTop);
}
},
created(){ created(){
this.collectionId = parseInt(this.$route.params.collectionId); this.collectionId = parseInt(this.$route.params.collectionId);
this.$eventBusSearch.setCollectionId(this.collectionId); this.$eventBusSearch.setCollectionId(this.collectionId);
},
mounted() {
document.getElementById('collecion-page-container').addEventListener('scroll', this.handleScroll);
} }
} }

View File

@ -537,6 +537,7 @@ a:hover {
.table-container { .table-container {
padding: 0 $table-side-padding; padding: 0 $table-side-padding;
position: relative; position: relative;
margin-bottom: 40px;
.table-wrapper { .table-wrapper {
width: 100%; width: 100%;
@ -561,7 +562,10 @@ a:hover {
font-size: 0.85em !important; font-size: 0.85em !important;
font-weight: normal !important; font-weight: normal !important;
border-top: 1px solid $gray; border-top: 1px solid $gray;
padding: 0em 1.0em; padding-top: 0;
padding-bottom: 0;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
color: $gray-light; color: $gray-light;
.shown-items { .shown-items {
@ -569,7 +573,7 @@ a:hover {
} }
.items-per-page { .items-per-page {
flex-grow: 3; flex-grow: 5;
margin-top: 0.35em; margin-top: 0.35em;
.field-label { .field-label {
flex-grow: 5; flex-grow: 5;

View File

@ -386,6 +386,7 @@ export default {
// Tables // Tables
.table-wrapper { .table-wrapper {
.table { .table {
border-collapse: collapse;
tbody { tbody {
td { border-bottom: 0px solid $gray-light !important; } td { border-bottom: 0px solid $gray-light !important; }
} }