Skip to content

Commit b22b09a

Browse files
committed
added rtl toggle button
1 parent e34485e commit b22b09a

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

browser/components/CodeEditor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ export default class CodeEditor extends React.Component {
539539
rulers,
540540
enableRulers,
541541
enableMarkdownLint,
542-
customMarkdownLintConfig,
542+
customMarkdownLintConfig
543543
} = this.props
544544
if (prevProps.mode !== this.props.mode) {
545545
this.setMode(this.props.mode)
@@ -558,8 +558,8 @@ export default class CodeEditor extends React.Component {
558558
needRefresh = true
559559
}
560560
if (prevProps.RTL !== this.props.RTL) {
561-
this.editor.setOption('direction', this.props.RTL ? 'rtl' : 'ltr' )
562-
this.editor.setOption('rtlMoveVisually', this.props.RTL ? 'true' : 'false' )
561+
this.editor.setOption('direction', this.props.RTL ? 'rtl' : 'ltr')
562+
this.editor.setOption('rtlMoveVisually', this.props.RTL ? 'true' : 'false')
563563
}
564564
if (prevProps.enableMarkdownLint !== enableMarkdownLint || prevProps.customMarkdownLintConfig !== customMarkdownLintConfig) {
565565
if (!enableMarkdownLint) {

browser/components/MarkdownEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class MarkdownEditor extends React.Component {
325325
customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
326326
prettierConfig={config.editor.prettierConfig}
327327
deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
328-
RTL={RTL}
328+
RTL={RTL}
329329
/>
330330
<MarkdownPreview styleName={this.state.status === 'PREVIEW'
331331
? 'preview'
@@ -361,7 +361,7 @@ class MarkdownEditor extends React.Component {
361361
allowCustomCSS={config.preview.allowCustomCSS}
362362
lineThroughCheckbox={config.preview.lineThroughCheckbox}
363363
onDrop={(e) => this.handleDropImage(e)}
364-
RTL={RTL}
364+
RTL={RTL}
365365
/>
366366
</div>
367367
)

browser/main/Detail/MarkdownNoteDetail.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { confirmDeleteNote } from 'browser/lib/confirmDeleteNote'
3131
import markdownToc from 'browser/lib/markdown-toc-generator'
3232
import queryString from 'query-string'
3333
import { replace } from 'connected-react-router'
34-
import ToggleDirectionButton from "browser/main/Detail/ToggleDirectionButton";
34+
import ToggleDirectionButton from 'browser/main/Detail/ToggleDirectionButton'
3535

3636
class MarkdownNoteDetail extends React.Component {
3737
constructor (props) {
@@ -358,7 +358,7 @@ class MarkdownNoteDetail extends React.Component {
358358

359359
handleSwitchDirection () {
360360
// If in split mode, hide the lock button
361-
let direction = this.state.RTL
361+
const direction = this.state.RTL
362362
this.setState({ RTL: !direction })
363363
}
364364

@@ -529,7 +529,6 @@ class MarkdownNoteDetail extends React.Component {
529529
/>
530530
</div>
531531

532-
533532
</div>
534533

535534
return (

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
},
213213
"husky": {
214214
"hooks": {
215-
"pre-commit": ""
215+
"pre-commit": "npm run lint"
216216
}
217217
}
218218
}

0 commit comments

Comments
 (0)