summaryrefslogtreecommitdiffstats
path: root/public/js/index.js
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-07-17 05:04:43 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-07-17 10:04:43 +0800
commitf33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee (patch)
tree2c6a268356fcb5fd73ee468055869b129b14c6ed /public/js/index.js
parent047a67a90b455a077e8b6f6deaad6b7ec4b50810 (diff)
downloadgitea-f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee.tar.gz
gitea-f33e6ae09ec27e898bb8f2cc44d587ea3b8e0dee.zip
Remove unit types commits and settings (#2161)
* Remove unit types commits and settings * Can not limit units in administrator teams * Limit changing units only to teams with read and write access mode * Small code optimization
Diffstat (limited to 'public/js/index.js')
-rw-r--r--public/js/index.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js
index f6da4125be..d79b94b92c 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -657,6 +657,18 @@ function initRepositoryCollaboration() {
});
}
+function initTeamSettings() {
+ // Change team access mode
+ $('.organization.new.team input[name=permission]').change(function () {
+ var val = $('input[name=permission]:checked', '.organization.new.team').val()
+ if (val === 'admin') {
+ $('.organization.new.team .team-units').hide();
+ } else {
+ $('.organization.new.team .team-units').show();
+ }
+ });
+}
+
function initWikiForm() {
var $editArea = $('.repository.wiki textarea#edit_area');
if ($editArea.length > 0) {
@@ -1557,6 +1569,7 @@ $(document).ready(function () {
initAdmin();
initCodeView();
initDashboardSearch();
+ initTeamSettings();
// Repo clone url.
if ($('#repo-clone-url').length > 0) {