Skip to content

Instantly share code, notes, and snippets.

@domagude
Last active November 27, 2017 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domagude/0dee5290bc70cc6f084cd7825fa5a03c to your computer and use it in GitHub Desktop.
Save domagude/0dee5290bc70cc6f084cd7825fa5a03c to your computer and use it in GitHub Desktop.
// on the add-user-to-contacts link click
// remove the link and notify, that the request has been sent
$(document).on('click',
'.add-user-to-contacts, .add-user-to-contacts-notif',
function(e) {
var conversation_window = $(this).parents('.conversation-window,\
.conversation');
conversation_window
.find('.add-user-to-contacts')
.replaceWith('<div class="contact-request-sent"\
style="display: block;">\
<div>\
<i class="fa fa-question"\
aria-hidden="true"\
title="Contact request sent">\
</i>\
</div>\
</div>');
conversation_window.find('.add-user-to-contacts-message').remove();
conversation_window
.find('.messages_list ul')
.append('<div class="add-user-to-contacts-message">\
Contact request sent\
</div>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment