aboutsummaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-02-17 15:10:50 -0500
committerUnknwon <u@gogs.io>2017-02-17 15:10:50 -0500
commit7e09d210ba421a1baf03ef7ba8770bebe8d28b72 (patch)
tree1d209f6175c3e4d7e21c4bda62e65db0ac4608f5 /public/js
parentdab768212af15f4e671e5403ad3def455117f699 (diff)
Initial version of protected branches (#776)
- Able to restrict force push and deletion - Able to restrict direct push
Diffstat (limited to 'public/js')
-rw-r--r--public/js/gogs.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js
index 45b11fe7..58fed2cc 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -341,6 +341,18 @@ function initRepository() {
});
}
+ // Branches
+ if ($('.repository.settings.branches').length > 0) {
+ initFilterSearchDropdown('.protected-branches .dropdown');
+ $('.enable-protection').change(function () {
+ if (this.checked) {
+ $($(this).data('target')).removeClass('disabled');
+ } else {
+ $($(this).data('target')).addClass('disabled');
+ }
+ });
+ }
+
// Labels
if ($('.repository.labels').length > 0) {
// Create label