Skip to content

Commit

Permalink
ctrl+s / meta+s should issue the save (untested in windows clients)
Browse files Browse the repository at this point in the history
  • Loading branch information
jejacks0n committed Jan 1, 2012
1 parent 3a49f60 commit 206085b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions vendor/assets/javascripts/mercury/page_editor.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ class @Mercury.PageEditor
jQuery(window).on 'resize', =>
@resize()

jQuery(@document).bind 'keydown', (event) =>
return unless event.ctrlKey || event.metaKey
if (event.keyCode == 83) # meta+S
Mercury.trigger('action', {action: 'save'})
event.preventDefault()

jQuery(window).bind 'keydown', (event) =>
return unless event.ctrlKey || event.metaKey
if (event.keyCode == 83) # meta+S
Mercury.trigger('action', {action: 'save'})
event.preventDefault()

window.onbeforeunload = @beforeUnload


Expand Down

0 comments on commit 206085b

Please sign in to comment.