mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Scroll Bars can now be hidden (#2713)
* Scroll Bars can now be hidden * Fix lint problems * fix lint errors * Fix lint * Fix lint * Change scrollBar to showScrollBar
This commit is contained in:
@@ -11,6 +11,7 @@ import mermaidRender from './render/MermaidRender'
|
|||||||
import SequenceDiagram from '@rokt33r/js-sequence-diagrams'
|
import SequenceDiagram from '@rokt33r/js-sequence-diagrams'
|
||||||
import Chart from 'chart.js'
|
import Chart from 'chart.js'
|
||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
|
import config from 'browser/main/lib/ConfigManager'
|
||||||
import htmlTextHelper from 'browser/lib/htmlTextHelper'
|
import htmlTextHelper from 'browser/lib/htmlTextHelper'
|
||||||
import convertModeName from 'browser/lib/convertModeName'
|
import convertModeName from 'browser/lib/convertModeName'
|
||||||
import copy from 'copy-to-clipboard'
|
import copy from 'copy-to-clipboard'
|
||||||
@@ -194,10 +195,12 @@ ${allowCustomCSS ? customCSS : ''}
|
|||||||
|
|
||||||
const scrollBarStyle = `
|
const scrollBarStyle = `
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
|
${config.get().ui.showScrollBar ? '' : 'display: none;'}
|
||||||
width: 12px;
|
width: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
|
${config.get().ui.showScrollBar ? '' : 'display: none;'}
|
||||||
background-color: rgba(0, 0, 0, 0.15);
|
background-color: rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,10 +210,12 @@ const scrollBarStyle = `
|
|||||||
`
|
`
|
||||||
const scrollBarDarkStyle = `
|
const scrollBarDarkStyle = `
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
|
${config.get().ui.showScrollBar ? '' : 'display: none;'}
|
||||||
width: 12px;
|
width: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
|
${config.get().ui.showScrollBar ? '' : 'display: none;'}
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { store, history } from './store'
|
|||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
require('!!style!css!stylus?sourceMap!./global.styl')
|
require('!!style!css!stylus?sourceMap!./global.styl')
|
||||||
|
import config from 'browser/main/lib/ConfigManager'
|
||||||
import { Route, Switch, Redirect } from 'react-router-dom'
|
import { Route, Switch, Redirect } from 'react-router-dom'
|
||||||
import { ConnectedRouter } from 'connected-react-router'
|
import { ConnectedRouter } from 'connected-react-router'
|
||||||
import DevTools from './DevTools'
|
import DevTools from './DevTools'
|
||||||
@@ -77,6 +78,16 @@ document.addEventListener('click', function(e) {
|
|||||||
if (infoPanel) infoPanel.style.display = 'none'
|
if (infoPanel) infoPanel.style.display = 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!config.get().ui.showScrollBar) {
|
||||||
|
document.styleSheets[54].insertRule('::-webkit-scrollbar {display: none}')
|
||||||
|
document.styleSheets[54].insertRule(
|
||||||
|
'::-webkit-scrollbar-corner {display: none}'
|
||||||
|
)
|
||||||
|
document.styleSheets[54].insertRule(
|
||||||
|
'::-webkit-scrollbar-thumb {display: none}'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const el = document.getElementById('content')
|
const el = document.getElementById('content')
|
||||||
|
|
||||||
function notify(...args) {
|
function notify(...args) {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export const DEFAULT_CONFIG = {
|
|||||||
theme: 'default',
|
theme: 'default',
|
||||||
showCopyNotification: true,
|
showCopyNotification: true,
|
||||||
disableDirectWrite: false,
|
disableDirectWrite: false,
|
||||||
|
showScrollBar: true,
|
||||||
defaultNote: 'ALWAYS_ASK', // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE'
|
defaultNote: 'ALWAYS_ASK', // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE'
|
||||||
showMenuBar: false
|
showMenuBar: false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ class UiTab extends React.Component {
|
|||||||
showTagsAlphabetically: this.refs.showTagsAlphabetically.checked,
|
showTagsAlphabetically: this.refs.showTagsAlphabetically.checked,
|
||||||
saveTagsAlphabetically: this.refs.saveTagsAlphabetically.checked,
|
saveTagsAlphabetically: this.refs.saveTagsAlphabetically.checked,
|
||||||
enableLiveNoteCounts: this.refs.enableLiveNoteCounts.checked,
|
enableLiveNoteCounts: this.refs.enableLiveNoteCounts.checked,
|
||||||
|
showScrollBar: this.refs.showScrollBar.checked,
|
||||||
showMenuBar: this.refs.showMenuBar.checked,
|
showMenuBar: this.refs.showMenuBar.checked,
|
||||||
disableDirectWrite:
|
disableDirectWrite:
|
||||||
this.refs.uiD2w != null ? this.refs.uiD2w.checked : false
|
this.refs.uiD2w != null ? this.refs.uiD2w.checked : false
|
||||||
@@ -351,9 +352,21 @@ class UiTab extends React.Component {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
<div styleName='group-checkBoxSection'>
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
onChange={e => this.handleUIChange(e)}
|
||||||
|
checked={this.state.config.ui.showScrollBar}
|
||||||
|
ref='showScrollBar'
|
||||||
|
type='checkbox'
|
||||||
|
/>
|
||||||
|
|
||||||
|
{i18n.__(
|
||||||
|
'Show the scroll bars in the editor and in the markdown preview (It will be applied after restarting)'
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div styleName='group-header2'>Tags</div>
|
<div styleName='group-header2'>Tags</div>
|
||||||
|
|
||||||
<div styleName='group-checkBoxSection'>
|
<div styleName='group-checkBoxSection'>
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
|
|||||||
Reference in New Issue
Block a user