hide REMOVE MEMBER button when showing Pending Band Members
This commit is contained in:
parent
64824d3587
commit
9938ec0a1d
|
|
@ -303,7 +303,7 @@
|
|||
function bindMembers() {
|
||||
rest.getBandMembers(bandId, false)
|
||||
.done(function(response) {
|
||||
bindMusicians(response);
|
||||
bindMusicians(response, false);
|
||||
if (isMember) {
|
||||
bindPendingMembers();
|
||||
}
|
||||
|
|
@ -323,7 +323,7 @@
|
|||
.done(function(response) {
|
||||
if (response && response.length > 0) {
|
||||
$("#band-profile-members").append("<br/><br/><h2><b>Pending Band Invitations</b></h2>");
|
||||
bindMusicians(response);
|
||||
bindMusicians(response, true);
|
||||
}
|
||||
})
|
||||
.fail(function(xhr) {
|
||||
|
|
@ -336,7 +336,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function bindMusicians(musicians) {
|
||||
function bindMusicians(musicians, isPending) {
|
||||
$.each(musicians, function(index, musician) {
|
||||
var instrumentLogoHtml = '';
|
||||
if ("instruments" in musician) {
|
||||
|
|
@ -369,7 +369,7 @@
|
|||
|
||||
// wire up Follow button click handler
|
||||
configureMemberFollowingButton(musician.is_following, musician.id);
|
||||
configureRemoveMemberButton(musician.id);
|
||||
configureRemoveMemberButton(musician.id, isPending);
|
||||
|
||||
// TODO: wire up Friend button click handler
|
||||
// var friend = isFriend(musician.id);
|
||||
|
|
@ -377,11 +377,11 @@
|
|||
});
|
||||
}
|
||||
|
||||
function configureRemoveMemberButton(userId) {
|
||||
function configureRemoveMemberButton(userId, isPending) {
|
||||
|
||||
var $divMember = $('div[user-id=' + userId + ']', '#band-profile-members');
|
||||
var $btnRemoveMember = $divMember.find('#btn-remove-member');
|
||||
if (isMember) {
|
||||
if (isMember && !isPending) {
|
||||
$btnRemoveMember.show();
|
||||
$btnRemoveMember.unbind("click");
|
||||
$btnRemoveMember.click(function() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue