mirror of
https://github.com/Luzifer/past3.git
synced 2024-12-22 20:31:16 +00:00
Bind ctrl+s / ctrl+n to buttons
This commit is contained in:
parent
4321dd05b9
commit
a498c9fc04
1 changed files with 11 additions and 0 deletions
11
app.coffee
11
app.coffee
|
@ -47,6 +47,17 @@ $ ->
|
|||
if $(this).data('file') == filename
|
||||
$(this).addClass 'active'
|
||||
|
||||
$(window).bind 'keydown', (e) ->
|
||||
if (e.metaKey or e.ctrlKey) and e.keyCode == 83 # cmd+s / ctrl+s
|
||||
$('#saveFile').trigger 'click'
|
||||
e.preventDefault()
|
||||
return false
|
||||
|
||||
if (e.metaKey or e.ctrlKey) and e.keyCode == 78 # cmd+n / ctrl+n
|
||||
$('#newFile').trigger 'click'
|
||||
e.preventDefault()
|
||||
return false
|
||||
|
||||
signinCallback = (authResult) ->
|
||||
if authResult.Zi.id_token
|
||||
getAWSCredentials authResult.Zi.id_token
|
||||
|
|
Loading…
Reference in a new issue