mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-11-10 00:11:34 +08:00
fix(undo): properly scope composer keymappings for undo/redo
Summary: Properly scopes undo & redo key bindings to the composer Test Plan: manual Reviewers: dillon, bengotow Reviewed By: bengotow Maniphest Tasks: T3446 Differential Revision: https://phab.nylas.com/D1951
This commit is contained in:
parent
d0dcfb8359
commit
e639afae1e
5 changed files with 31 additions and 15 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
div[contenteditable]':
|
div[contenteditable]':
|
||||||
'cmd-B' : 'composer:show-and-focus-bcc'
|
'cmd-B' : 'composer:show-and-focus-bcc'
|
||||||
'cmd-C' : 'composer:show-and-focus-cc'
|
'cmd-C' : 'composer:show-and-focus-cc'
|
||||||
|
'ctrl-B' : 'composer:show-and-focus-bcc'
|
||||||
|
'ctrl-C' : 'composer:show-and-focus-cc'
|
||||||
'cmd-enter' : 'composer:send-message'
|
'cmd-enter' : 'composer:send-message'
|
||||||
'ctrl-enter' : 'composer:send-message'
|
'ctrl-enter' : 'composer:send-message'
|
||||||
|
|
||||||
|
|
@ -15,3 +17,18 @@ div[contenteditable]':
|
||||||
'enter' : 'composer:send-message'
|
'enter' : 'composer:send-message'
|
||||||
'tab' : 'composer:focus-to'
|
'tab' : 'composer:focus-to'
|
||||||
'shift-tab' : 'native!'
|
'shift-tab' : 'native!'
|
||||||
|
|
||||||
|
'body.platform-win32 .composer-outer-wrap *[contenteditable], body.platform-win32 .composer-outer-wrap input':
|
||||||
|
'ctrl-z': 'composer:undo'
|
||||||
|
'ctrl-Z': 'composer:redo'
|
||||||
|
'ctrl-y': 'composer:redo'
|
||||||
|
|
||||||
|
'body.platform-linux .composer-outer-wrap *[contenteditable], body.platform-linux .composer-outer-wrap input':
|
||||||
|
'ctrl-z': 'composer:undo'
|
||||||
|
'ctrl-Z': 'composer:redo'
|
||||||
|
'ctrl-y': 'composer:redo'
|
||||||
|
|
||||||
|
'body.platform-darwin .composer-outer-wrap *[contenteditable], body.platform-darwin .composer-outer-wrap input':
|
||||||
|
'cmd-z': 'composer:undo'
|
||||||
|
'cmd-Z': 'composer:redo'
|
||||||
|
'cmd-y': 'composer:redo'
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,8 @@ class ComposerView extends React.Component
|
||||||
'composer:focus-to': => @focus "textFieldTo"
|
'composer:focus-to': => @focus "textFieldTo"
|
||||||
'composer:send-message': => @_sendDraft()
|
'composer:send-message': => @_sendDraft()
|
||||||
'composer:delete-empty-draft': => @_deleteDraftIfEmpty()
|
'composer:delete-empty-draft': => @_deleteDraftIfEmpty()
|
||||||
"core:undo": @undo
|
"composer:undo": @undo
|
||||||
"core:redo": @redo
|
"composer:redo": @redo
|
||||||
}
|
}
|
||||||
if @props.mode is "fullwindow"
|
if @props.mode is "fullwindow"
|
||||||
# Need to delay so the component can be fully painted. Focus doesn't
|
# Need to delay so the component can be fully painted. Focus doesn't
|
||||||
|
|
@ -736,5 +736,4 @@ class ComposerView extends React.Component
|
||||||
return unless @_proxy
|
return unless @_proxy
|
||||||
if @_proxy.draft().pristine then Actions.destroyDraft(@props.draftClientId)
|
if @_proxy.draft().pristine then Actions.destroyDraft(@props.draftClientId)
|
||||||
|
|
||||||
|
|
||||||
module.exports = ComposerView
|
module.exports = ComposerView
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
'ctrl-alt-cmd-l': 'window:reload'
|
'ctrl-alt-cmd-l': 'window:reload'
|
||||||
'cmd-alt-ctrl-p': 'application:run-package-specs'
|
'cmd-alt-ctrl-p': 'application:run-package-specs'
|
||||||
|
|
||||||
'body div *[contenteditable]':
|
'body *[contenteditable]':
|
||||||
'cmd-z': 'core:undo'
|
'cmd-z': 'native!'
|
||||||
'cmd-Z': 'core:redo'
|
'cmd-Z': 'native!'
|
||||||
'cmd-y': 'core:redo'
|
'cmd-y': 'native!'
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
'ctrl-alt-s': 'application:run-all-specs'
|
'ctrl-alt-s': 'application:run-all-specs'
|
||||||
'F11': 'window:toggle-full-screen'
|
'F11': 'window:toggle-full-screen'
|
||||||
|
|
||||||
'body div *[contenteditable]':
|
'body *[contenteditable]':
|
||||||
'ctrl-z': 'core:undo'
|
'ctrl-z': 'native!'
|
||||||
'ctrl-Z': 'core:redo'
|
'ctrl-Z': 'native!'
|
||||||
'ctrl-y': 'core:redo'
|
'ctrl-y': 'native!'
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
'ctrl-alt-s': 'application:run-all-specs'
|
'ctrl-alt-s': 'application:run-all-specs'
|
||||||
'F11': 'window:toggle-full-screen'
|
'F11': 'window:toggle-full-screen'
|
||||||
|
|
||||||
'body div *[contenteditable]':
|
'body *[contenteditable]':
|
||||||
'ctrl-z': 'core:undo'
|
'ctrl-z': 'native!'
|
||||||
'ctrl-Z': 'core:redo'
|
'ctrl-Z': 'native!'
|
||||||
'ctrl-y': 'core:redo'
|
'ctrl-y': 'native!'
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue