mirror of
https://github.com/Findus23/HNReader.git
synced 2024-09-19 15:23:44 +02:00
scroll up on new comment page
This commit is contained in:
parent
5afa71fa86
commit
a062d75f35
3 changed files with 8 additions and 3 deletions
|
@ -18,7 +18,7 @@ html, body {
|
|||
background: white;
|
||||
}
|
||||
|
||||
#sidebar .stories, #mainpane .comments, #mainpane .reader {
|
||||
#sidebar .stories, #mainpane #comments, #mainpane .reader {
|
||||
overflow-y: auto;
|
||||
height: calc(100% - #{$topNavBarHeight});
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ pre {
|
|||
}
|
||||
}
|
||||
|
||||
.comments {
|
||||
#comments {
|
||||
background: $backgroundColorLighter;
|
||||
|
||||
.kids .kids {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="comments">
|
||||
<div id="comments">
|
||||
<Header :item="story"></Header>
|
||||
<comment v-if="!story.url" :item="story" :original-author="story.by" :text-post="true"></comment>
|
||||
<div v-if="loading">LOADING</div>
|
||||
|
@ -40,6 +40,11 @@ export default defineComponent({
|
|||
})
|
||||
.then(data => (this.story = data))
|
||||
.then(a => {
|
||||
const el = document.getElementById("comments");
|
||||
if (el) {
|
||||
console.log(el)
|
||||
el.scrollTop = 0
|
||||
}
|
||||
this.loading = false;
|
||||
document.title = this.story.title
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue