mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
TOC: Scrolling: Fixed TOC links and scrolling
This commit is contained in:
committed by
Junyoung Choi
parent
9996b5d686
commit
132d04326b
@@ -183,6 +183,10 @@ const scrollBarStyle = `
|
|||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
background-color: rgba(0, 0, 0, 0.15);
|
background-color: rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track-piece {
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
const scrollBarDarkStyle = `
|
const scrollBarDarkStyle = `
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
@@ -192,6 +196,10 @@ const scrollBarDarkStyle = `
|
|||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track-piece {
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const OSX = global.process.platform === 'darwin'
|
const OSX = global.process.platform === 'darwin'
|
||||||
@@ -684,7 +692,6 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
allowCustomCSS,
|
allowCustomCSS,
|
||||||
customCSS
|
customCSS
|
||||||
})
|
})
|
||||||
this.getWindow().document.documentElement.style.overflowY = 'hidden'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCodeThemeLink (name) {
|
getCodeThemeLink (name) {
|
||||||
@@ -1066,7 +1073,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
if (posOfHash > -1) {
|
if (posOfHash > -1) {
|
||||||
const extractedId = linkHash.slice(posOfHash + 1)
|
const extractedId = linkHash.slice(posOfHash + 1)
|
||||||
const targetId = mdurl.encode(extractedId)
|
const targetId = mdurl.encode(extractedId)
|
||||||
const targetElement = this.refs.root.contentWindow.document.getElementById(
|
const targetElement = this.getWindow().document.getElementById(
|
||||||
targetId
|
targetId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user