Skip to content

Commit e7615ed

Browse files
amedoraRokt33r
authored andcommitted
add "Wrap Line" button handlers
1 parent fe50830 commit e7615ed

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

browser/main/Detail/SnippetNoteDetail.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,19 @@ class SnippetNoteDetail extends React.Component {
518518
])
519519
}
520520

521+
handleWrapLineButtonClick (e) {
522+
context.popup([
523+
{
524+
label: 'on',
525+
click: (e) => this.handleWrapLineItemClick(e, true)
526+
},
527+
{
528+
label: 'off',
529+
click: (e) => this.handleWrapLineItemClick(e, false)
530+
}
531+
])
532+
}
533+
521534
handleIndentSizeItemClick (e, indentSize) {
522535
const { config, dispatch } = this.props
523536
const editor = Object.assign({}, config.editor, {
@@ -550,6 +563,22 @@ class SnippetNoteDetail extends React.Component {
550563
})
551564
}
552565

566+
handleWrapLineItemClick (e, lineWrapping) {
567+
const { config, dispatch } = this.props
568+
const editor = Object.assign({}, config.editor, {
569+
lineWrapping
570+
})
571+
ConfigManager.set({
572+
editor
573+
})
574+
dispatch({
575+
type: 'SET_CONFIG',
576+
config: {
577+
editor
578+
}
579+
})
580+
}
581+
553582
focus () {
554583
this.refs.description.focus()
555584
}

0 commit comments

Comments
 (0)