diff options
author | Unknwon <u@gogs.io> | 2016-07-31 01:26:43 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-07-31 01:26:43 +0800 |
commit | 991ce42c48d2dc5e8be42245a432e782df0f3d23 (patch) | |
tree | d3ed0596b2fa3875c02267755335679fa83893d8 /public | |
parent | 10dc33064002f44098668dbd68163aabed6658d3 (diff) | |
download | gitea-991ce42c48d2dc5e8be42245a432e782df0f3d23.tar.gz gitea-991ce42c48d2dc5e8be42245a432e782df0f3d23.zip |
#2162 improve repository advance options UI display
Enable/disable input based on user chosen options for wiki and issue tracker.
Diffstat (limited to 'public')
-rw-r--r-- | public/js/gogs.js | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index 7f764a8bed..7ca90b2826 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -250,6 +250,22 @@ function initRepository() { $prompt_span.hide(); } }); + + // Enable or select internal/external wiki system and issue tracker. + $('.enable-system').change(function () { + if (this.checked) { + $($(this).data('target')).removeClass('disabled'); + } else { + $($(this).data('target')).addClass('disabled'); + } + }); + $('.enable-system-radio').change(function () { + if (this.value == 'false') { + $($(this).data('target')).addClass('disabled'); + } else if (this.value == 'true') { + $($(this).data('target')).removeClass('disabled'); + } + }); } // Labels @@ -410,7 +426,7 @@ function initRepository() { if (confirm($this.data('locale'))) { $.post($this.data('url'), { "_csrf": csrf - }).success(function() { + }).success(function () { $('#' + $this.data('comment-id')).remove(); }); } @@ -471,11 +487,11 @@ function initRepository() { } } -function initRepositoryCollaboration(){ +function initRepositoryCollaboration() { console.log('initRepositoryCollaboration'); // Change collaborator access mode - $('.access-mode.menu .item').click(function(){ + $('.access-mode.menu .item').click(function () { var $menu = $(this).parent(); $.post($menu.data('url'), { "_csrf": csrf, @@ -971,11 +987,11 @@ $(document).ready(function () { $('.show-modal.button').click(function () { $($(this).data('modal')).modal('show'); }); - $('.delete-post.button').click(function(){ + $('.delete-post.button').click(function () { var $this = $(this); - $.post($this.data('request-url'),{ + $.post($this.data('request-url'), { "_csrf": csrf - }).done(function(){ + }).done(function () { window.location.href = $this.data('done-url'); }); }); @@ -1129,7 +1145,7 @@ $(window).load(function () { } }); -$(function() { - if ($('.user.signin').length >0) return; - $('form').areYouSure(); +$(function () { + if ($('.user.signin').length > 0) return; + $('form').areYouSure(); }); |