user can be added to group and team from user page
This commit is contained in:
parent
30d8b7bd85
commit
f0c6691df2
10 changed files with 298 additions and 55 deletions
|
@ -8,19 +8,23 @@ $('a[role="remove"]').on("click", function () {
|
|||
a.html('removing...');
|
||||
$.ajax(href)
|
||||
.done(function(data, textStatus) {
|
||||
a.parents('li').remove();
|
||||
var counter = $('#' + type + '-counter');
|
||||
var empty = $('#' + type + '-empty');
|
||||
var count = parseInt(counter.html());
|
||||
count--;
|
||||
counter.html(count);
|
||||
if (count < 0) {
|
||||
// should not happen
|
||||
window.location.reload();
|
||||
} else if (count == 0) {
|
||||
empty.removeClass('hidden');
|
||||
if (data) {
|
||||
a.parents('span').html(data);
|
||||
} else {
|
||||
empty.addClass('hidden');
|
||||
a.parents('li').remove();
|
||||
var counter = $('#' + type + '-counter');
|
||||
var empty = $('#' + type + '-empty');
|
||||
var count = parseInt(counter.html());
|
||||
count--;
|
||||
counter.html(count);
|
||||
if (count < 0) {
|
||||
// should not happen
|
||||
window.location.reload();
|
||||
} else if (count == 0) {
|
||||
empty.removeClass('hidden');
|
||||
} else {
|
||||
empty.addClass('hidden');
|
||||
}
|
||||
}
|
||||
})
|
||||
.fail(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue