From a498c9fc04fda03cc322666640076de283270d4f Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 26 Jan 2017 09:07:06 +0100 Subject: [PATCH] Bind ctrl+s / ctrl+n to buttons --- app.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app.coffee b/app.coffee index 04ae2eb..236ade6 100644 --- a/app.coffee +++ b/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