diff options
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r-- | public/js/gogs.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index 34bd840606..6827aada84 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -367,6 +367,23 @@ function initRepository() { } }; +function initWebhook() { + if ($('.new.webhook').length == 0) { + return; + } + + $('.events.checkbox input').change(function () { + if ($(this).is(':checked')) { + $('.events.fields').show(); + } + }); + $('.non-events.checkbox input').change(function () { + if ($(this).is(':checked')) { + $('.events.fields').hide(); + } + }); +} + $(document).ready(function () { csrf = $('meta[name=_csrf]').attr("content"); @@ -473,4 +490,5 @@ $(document).ready(function () { initCommentForm(); initInstall(); initRepository(); + initWebhook(); });
\ No newline at end of file |