aboutsummaryrefslogtreecommitdiffstats
path: root/public/ng/js/gogs.js
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-24 21:09:05 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-24 21:09:05 +0800
commit21a1b8e5a35c61bff30145ac3194ea893a9c6b68 (patch)
treeb218aedd0d64252d95725f12338a1ced1f155ba9 /public/ng/js/gogs.js
parente325c8499a102ba8a6a84236c02dd7951f46cec5 (diff)
downloadgitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.tar.gz
gitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.zip
Finish new edit team page, add member to team
Diffstat (limited to 'public/ng/js/gogs.js')
-rw-r--r--public/ng/js/gogs.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js
index 5e6a6a6b91..52000f3664 100644
--- a/public/ng/js/gogs.js
+++ b/public/ng/js/gogs.js
@@ -351,6 +351,41 @@ function initInvite() {
});
}
+function initOrgTeamCreate() {
+ // Delete team.
+ $('#org-team-delete').click(function (e) {
+ if (!confirm('This team is going to be deleted, do you want to continue?')) {
+ e.preventDefault();
+ return true;
+ }
+ var $form = $('#team-create-form')
+ $form.attr('action', $form.data('delete-url'));
+ });
+}
+
+function initTeamMembersList() {
+ // Add team member.
+ var $ul = $('#org-team-members-list');
+ $('#org-team-members-add').on('keyup', function () {
+ var $this = $(this);
+ if (!$this.val()) {
+ $ul.toggleHide();
+ return;
+ }
+ Gogs.searchUsers($this.val(), $ul);
+ }).on('focus', function () {
+ if (!$(this).val()) {
+ $ul.toggleHide();
+ } else {
+ $ul.toggleShow();
+ }
+ }).next().next().find('ul').on("click", 'li', function () {
+ $('#org-team-members-add').val($(this).text());
+ $ul.toggleHide();
+ });
+
+}
+
$(document).ready(function () {
initCore();
if ($('#user-profile-setting').length) {
@@ -368,6 +403,12 @@ $(document).ready(function () {
if ($('#invite-box').length) {
initInvite();
}
+ if ($('#team-create-form').length) {
+ initOrgTeamCreate();
+ }
+ if ($('#team-members-list').length) {
+ initTeamMembersList();
+ }
Tabs('#dashboard-sidebar-menu');