Skip to content

Commit 132d043

Browse files
shmolfRokt33r
authored andcommitted
TOC: Scrolling: Fixed TOC links and scrolling
1 parent 9996b5d commit 132d043

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

browser/components/MarkdownPreview.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ const scrollBarStyle = `
183183
::-webkit-scrollbar-thumb {
184184
background-color: rgba(0, 0, 0, 0.15);
185185
}
186+
187+
::-webkit-scrollbar-track-piece {
188+
background-color: inherit;
189+
}
186190
`
187191
const scrollBarDarkStyle = `
188192
::-webkit-scrollbar {
@@ -192,6 +196,10 @@ const scrollBarDarkStyle = `
192196
::-webkit-scrollbar-thumb {
193197
background-color: rgba(0, 0, 0, 0.3);
194198
}
199+
200+
::-webkit-scrollbar-track-piece {
201+
background-color: inherit;
202+
}
195203
`
196204

197205
const OSX = global.process.platform === 'darwin'
@@ -684,7 +692,6 @@ export default class MarkdownPreview extends React.Component {
684692
allowCustomCSS,
685693
customCSS
686694
})
687-
this.getWindow().document.documentElement.style.overflowY = 'hidden'
688695
}
689696

690697
getCodeThemeLink (name) {
@@ -1066,7 +1073,7 @@ export default class MarkdownPreview extends React.Component {
10661073
if (posOfHash > -1) {
10671074
const extractedId = linkHash.slice(posOfHash + 1)
10681075
const targetId = mdurl.encode(extractedId)
1069-
const targetElement = this.refs.root.contentWindow.document.getElementById(
1076+
const targetElement = this.getWindow().document.getElementById(
10701077
targetId
10711078
)
10721079

0 commit comments

Comments
 (0)