summaryrefslogtreecommitdiffstats
path: root/public/ng/js
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-09-07 19:30:51 -0400
committer无闻 <joe2010xtmf@163.com>2014-09-07 19:30:51 -0400
commite79e4b158090bf7c5dd86ac21cd0dbf44fbc82bd (patch)
treeaec4d8a53265080363b3ab7a4423bc0820133ea5 /public/ng/js
parent40bc130b19cf71a997d5073a2587ea2649128bf8 (diff)
parentf7be61c81935a30c21797351db5da32183e3188d (diff)
downloadgitea-e79e4b158090bf7c5dd86ac21cd0dbf44fbc82bd.tar.gz
gitea-e79e4b158090bf7c5dd86ac21cd0dbf44fbc82bd.zip
Merge pull request #442 from compressed/org_hook
Organization-level Webhooks
Diffstat (limited to 'public/ng/js')
-rw-r--r--public/ng/js/gogs.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js
index cb23c8f97b..74bb6cc222 100644
--- a/public/ng/js/gogs.js
+++ b/public/ng/js/gogs.js
@@ -349,17 +349,8 @@ function initRepo() {
})
}
-function initRepoSetting() {
- // Options.
- // Confirmation of changing repository name.
- $('#repo-setting-form').submit(function (e) {
- var $reponame = $('#repo_name');
- if (($reponame.data('repo-name') != $reponame.val()) && !confirm('Repository name has been changed, do you want to continue?')) {
- e.preventDefault();
- return true;
- }
- });
-
+// when user changes hook type, hide/show proper divs
+function initHookTypeChange() {
// web hook type change
$('select#hook-type').on("change", function () {
hookTypes = ['Gogs','Slack'];
@@ -374,6 +365,20 @@ function initRepoSetting() {
}
});
});
+}
+
+function initRepoSetting() {
+ // Options.
+ // Confirmation of changing repository name.
+ $('#repo-setting-form').submit(function (e) {
+ var $reponame = $('#repo_name');
+ if (($reponame.data('repo-name') != $reponame.val()) && !confirm('Repository name has been changed, do you want to continue?')) {
+ e.preventDefault();
+ return true;
+ }
+ });
+
+ initHookTypeChange();
$('#transfer-button').click(function () {
$('#transfer-form').show();
@@ -421,6 +426,8 @@ function initOrgSetting() {
return true;
}
});
+
+ initHookTypeChange();
}
function initInvite() {