1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-12 17:26:17 +00:00

added rtl toggle button

This commit is contained in:
Itai Braude
2019-10-17 21:04:00 +03:00
parent e34485eb83
commit b22b09a93d
4 changed files with 8 additions and 9 deletions

View File

@@ -539,7 +539,7 @@ export default class CodeEditor extends React.Component {
rulers,
enableRulers,
enableMarkdownLint,
customMarkdownLintConfig,
customMarkdownLintConfig
} = this.props
if (prevProps.mode !== this.props.mode) {
this.setMode(this.props.mode)
@@ -558,8 +558,8 @@ export default class CodeEditor extends React.Component {
needRefresh = true
}
if (prevProps.RTL !== this.props.RTL) {
this.editor.setOption('direction', this.props.RTL ? 'rtl' : 'ltr' )
this.editor.setOption('rtlMoveVisually', this.props.RTL ? 'true' : 'false' )
this.editor.setOption('direction', this.props.RTL ? 'rtl' : 'ltr')
this.editor.setOption('rtlMoveVisually', this.props.RTL ? 'true' : 'false')
}
if (prevProps.enableMarkdownLint !== enableMarkdownLint || prevProps.customMarkdownLintConfig !== customMarkdownLintConfig) {
if (!enableMarkdownLint) {

View File

@@ -325,7 +325,7 @@ class MarkdownEditor extends React.Component {
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
prettierConfig={config.editor.prettierConfig}
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
RTL={RTL}
RTL={RTL}
/>
<MarkdownPreview styleName={this.state.status === 'PREVIEW'
? 'preview'
@@ -361,7 +361,7 @@ class MarkdownEditor extends React.Component {
allowCustomCSS={config.preview.allowCustomCSS}
lineThroughCheckbox={config.preview.lineThroughCheckbox}
onDrop={(e) => this.handleDropImage(e)}
RTL={RTL}
RTL={RTL}
/>
</div>
)

View File

@@ -31,7 +31,7 @@ import { confirmDeleteNote } from 'browser/lib/confirmDeleteNote'
import markdownToc from 'browser/lib/markdown-toc-generator'
import queryString from 'query-string'
import { replace } from 'connected-react-router'
import ToggleDirectionButton from "browser/main/Detail/ToggleDirectionButton";
import ToggleDirectionButton from 'browser/main/Detail/ToggleDirectionButton'
class MarkdownNoteDetail extends React.Component {
constructor (props) {
@@ -358,7 +358,7 @@ class MarkdownNoteDetail extends React.Component {
handleSwitchDirection () {
// If in split mode, hide the lock button
let direction = this.state.RTL
const direction = this.state.RTL
this.setState({ RTL: !direction })
}
@@ -529,7 +529,6 @@ class MarkdownNoteDetail extends React.Component {
/>
</div>
</div>
return (

View File

@@ -212,7 +212,7 @@
},
"husky": {
"hooks": {
"pre-commit": ""
"pre-commit": "npm run lint"
}
}
}