Skip to content

Commit 5188846

Browse files
authored
Merge pull request #2611 from gregueiras/issue2199
Ability to go from 'editor with preview' mode to 'preview' using mouse
2 parents d874a3a + af14b68 commit 5188846

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

browser/components/MarkdownPreview.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import yaml from 'js-yaml'
2121
import context from 'browser/lib/context'
2222
import i18n from 'browser/lib/i18n'
2323
import fs from 'fs'
24+
import ConfigManager from '../main/lib/ConfigManager'
2425

2526
const { remote, shell } = require('electron')
2627
const attachmentManagement = require('../main/lib/dataApi/attachmentManagement')
@@ -263,6 +264,10 @@ export default class MarkdownPreview extends React.Component {
263264
}
264265

265266
handleMouseDown (e) {
267+
const config = ConfigManager.get()
268+
if (config.editor.switchPreview === 'RIGHTCLICK' && e.buttons === 2 && config.editor.type === 'SPLIT') {
269+
eventEmitter.emit('topbar:togglemodebutton', 'CODE')
270+
}
266271
if (e.target != null) {
267272
switch (e.target.tagName) {
268273
case 'A':

0 commit comments

Comments
 (0)