From 908f2924ceacc89bd75c5b89f68a653a16dcfbec Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 11 Nov 2015 16:19:28 -0500 Subject: fix #1824 and fix #1917 --- public/js/gogs.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'public/js') diff --git a/public/js/gogs.js b/public/js/gogs.js index f297191a..68e286bc 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -21,6 +21,8 @@ function initCommentPreviewTab($form) { } ); }); + + buttonsClickOnEnter(); } function initCommentForm() { @@ -537,6 +539,13 @@ function initAdmin() { } } +function buttonsClickOnEnter() { + $('.ui.button').keypress(function(e){ + if (e.keyCode == 13) + $(this).click(); + }); +} + $(document).ready(function () { csrf = $('meta[name=_csrf]').attr("content"); suburl = $('meta[name=_suburl]').attr("content"); @@ -670,6 +679,8 @@ $(document).ready(function () { $($(this).data('modal')).modal('show'); }); + buttonsClickOnEnter(); + initCommentForm(); initInstall(); initRepository(); -- cgit v1.2.3