mirror of https://github.com/FreeTubeApp/FreeTube
Fix scrolling through the download dropdown (#2425)
* Fix scrolling through the download dropdown * Fix lining issue
This commit is contained in:
parent
7ec1c1eb05
commit
651e95f7a0
|
@ -292,6 +292,18 @@ export default Vue.extend({
|
|||
}
|
||||
]
|
||||
})
|
||||
|
||||
this.$watch('$refs.downloadButton.dropdownShown', (dropdownShown) => {
|
||||
this.$parent.infoAreaSticky = !dropdownShown
|
||||
|
||||
if (dropdownShown && window.innerWidth >= 901) {
|
||||
// adds a slight delay so we know that the dropdown has shown up
|
||||
// and won't mess up our scrolling
|
||||
Promise.resolve().then(() => {
|
||||
this.$parent.$refs.infoArea.scrollIntoView()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
/>
|
||||
<ft-icon-button
|
||||
v-if="!isUpcoming && downloadLinks.length > 0"
|
||||
ref="downloadButton"
|
||||
:title="$t('Video.Download Video')"
|
||||
class="option"
|
||||
theme="secondary"
|
||||
|
|
|
@ -76,7 +76,8 @@ export default Vue.extend({
|
|||
timestamp: null,
|
||||
playNextTimeout: null,
|
||||
playNextCountDownIntervalId: null,
|
||||
pictureInPictureButtonInverval: null
|
||||
pictureInPictureButtonInverval: null,
|
||||
infoAreaSticky: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -68,7 +68,11 @@
|
|||
grid-area: info
|
||||
position: relative
|
||||
|
||||
@media only screen and (min-width: 901px)
|
||||
@media only screen and (min-width: 901px)
|
||||
.infoArea
|
||||
scroll-margin-top: 76px
|
||||
|
||||
.infoAreaSticky
|
||||
position: sticky
|
||||
top: 76px
|
||||
|
||||
|
|
|
@ -64,7 +64,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="infoArea">
|
||||
<div
|
||||
ref="infoArea"
|
||||
class="infoArea"
|
||||
:class="{ infoAreaSticky }"
|
||||
>
|
||||
<watch-video-info
|
||||
v-if="!isLoading"
|
||||
:id="videoId"
|
||||
|
|
Loading…
Reference in New Issue