From 132d04326b97196cd24f9fc47af256e8d8ec674a Mon Sep 17 00:00:00 2001 From: Nicholas Browning Date: Sat, 26 Oct 2019 17:37:13 -0400 Subject: [PATCH] TOC: Scrolling: Fixed TOC links and scrolling --- browser/components/MarkdownPreview.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index 2b74e4ec..12948c37 100755 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -183,6 +183,10 @@ const scrollBarStyle = ` ::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.15); } + +::-webkit-scrollbar-track-piece { + background-color: inherit; +} ` const scrollBarDarkStyle = ` ::-webkit-scrollbar { @@ -192,6 +196,10 @@ const scrollBarDarkStyle = ` ::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.3); } + +::-webkit-scrollbar-track-piece { + background-color: inherit; +} ` const OSX = global.process.platform === 'darwin' @@ -684,7 +692,6 @@ export default class MarkdownPreview extends React.Component { allowCustomCSS, customCSS }) - this.getWindow().document.documentElement.style.overflowY = 'hidden' } getCodeThemeLink (name) { @@ -1066,7 +1073,7 @@ export default class MarkdownPreview extends React.Component { if (posOfHash > -1) { const extractedId = linkHash.slice(posOfHash + 1) const targetId = mdurl.encode(extractedId) - const targetElement = this.refs.root.contentWindow.document.getElementById( + const targetElement = this.getWindow().document.getElementById( targetId )