1
0
Fork 0
mirror of https://github.com/Luzifer/past3.git synced 2024-11-10 00:40:00 +00:00

Bind ctrl+s / ctrl+n to buttons

This commit is contained in:
Knut Ahlers 2017-01-26 09:07:06 +01:00
parent 4321dd05b9
commit a498c9fc04
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -47,6 +47,17 @@ $ ->
if $(this).data('file') == filename if $(this).data('file') == filename
$(this).addClass 'active' $(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) -> signinCallback = (authResult) ->
if authResult.Zi.id_token if authResult.Zi.id_token
getAWSCredentials authResult.Zi.id_token getAWSCredentials authResult.Zi.id_token