add scroll to char for LibraryList
This commit is contained in:
@@ -8,14 +8,14 @@ a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
border: 0;
|
border: $line;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin-left: -#{$header-spacer-sm};
|
margin-left: -#{$header-spacer-sm};
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
.dropdown-item {
|
.dropdown-item {
|
||||||
font-size: $font-size-sm;
|
font-size: $font-size-sm;
|
||||||
padding: .25rem $header-spacer-sm;
|
padding: .25rem 1.25rem .25rem .5rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up($layout-bp) {
|
@include media-breakpoint-up($layout-bp) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<b-dropdown
|
<b-dropdown
|
||||||
:text="buttonText"
|
:text="buttonText"
|
||||||
variant="outline-dark" class="tags-dropdown d-tb-block"
|
variant="outline-dark" class="tags-dropdown d-tb-block"
|
||||||
|
dropright
|
||||||
>
|
>
|
||||||
<b-dropdown-item-button
|
<b-dropdown-item-button
|
||||||
v-for="tag in availableOptions" :key="tag"
|
v-for="tag in availableOptions" :key="tag"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"card-map": "Aléatoire",
|
"card-map": "Aléatoire",
|
||||||
"card-list": "Alphabétique"
|
"card-list": "Alphabétique"
|
||||||
},
|
},
|
||||||
|
"go-to-char": "Aller à la lettre",
|
||||||
"shuffle": "Mélanger"
|
"shuffle": "Mélanger"
|
||||||
},
|
},
|
||||||
"filters": {
|
"filters": {
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
<div class="library-list">
|
<div class="library-list">
|
||||||
<div class="library-list-container" @click="onContainerClick">
|
<div class="library-list-container" @click="onContainerClick">
|
||||||
<div v-for="([char, nodes]) in filteredNodes" :key="char">
|
<div v-for="([char, nodes]) in filteredNodes" :key="char">
|
||||||
<h3>{{ char }}</h3>
|
<h3 :id="char">
|
||||||
|
{{ char }}
|
||||||
|
</h3>
|
||||||
|
|
||||||
<div class="library-list-nodes-group">
|
<div class="library-list-nodes-group">
|
||||||
<node-view
|
<node-view
|
||||||
|
|||||||
@@ -19,6 +19,21 @@
|
|||||||
>
|
>
|
||||||
{{ $t('options.display.shuffle') }}
|
{{ $t('options.display.shuffle') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
|
|
||||||
|
<b-dropdown
|
||||||
|
v-if="activeMode === 'list'"
|
||||||
|
:text="$t('options.display.go-to-char')"
|
||||||
|
variant="outline-dark" class="char-select d-block mt-2"
|
||||||
|
dropright
|
||||||
|
>
|
||||||
|
<b-dropdown-item-button
|
||||||
|
class="text-center"
|
||||||
|
v-for="char in availableCharacters" :key="char"
|
||||||
|
@click="scrollToChar(char)"
|
||||||
|
>
|
||||||
|
{{ char }}
|
||||||
|
</b-dropdown-item-button>
|
||||||
|
</b-dropdown>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
<!-- LIST + MAP ONLY -->
|
<!-- LIST + MAP ONLY -->
|
||||||
@@ -116,6 +131,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'nodesDepartsOptions',
|
'nodesDepartsOptions',
|
||||||
|
'orderedTextsDepart',
|
||||||
'tagsOptions',
|
'tagsOptions',
|
||||||
'nodebook',
|
'nodebook',
|
||||||
'mode',
|
'mode',
|
||||||
@@ -125,6 +141,11 @@ export default {
|
|||||||
'strangeness'
|
'strangeness'
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
availableCharacters () {
|
||||||
|
if (!this.orderedTextsDepart) return []
|
||||||
|
return this.orderedTextsDepart.map(group => group[0])
|
||||||
|
},
|
||||||
|
|
||||||
activeNodeId: {
|
activeNodeId: {
|
||||||
get () { return this.nodeDepartId },
|
get () { return this.nodeDepartId },
|
||||||
set (value) {
|
set (value) {
|
||||||
@@ -173,6 +194,15 @@ export default {
|
|||||||
tagsIsActive () {
|
tagsIsActive () {
|
||||||
this.$store.commit('UPDATE_TAGS', [])
|
this.$store.commit('UPDATE_TAGS', [])
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
scrollToChar (char) {
|
||||||
|
const h = document.querySelector(`h3[id=${char}]`)
|
||||||
|
if (h) {
|
||||||
|
h.scrollIntoView({ behavior: 'smooth' })
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -232,6 +262,16 @@ export default {
|
|||||||
color: $black;
|
color: $black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.char-select {
|
||||||
|
line-height: 1;
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
max-height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
min-width: 3rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.filters-group {
|
.filters-group {
|
||||||
|
|||||||
Reference in New Issue
Block a user