1
Fork 0

Added jquery $ and better format for events

This commit is contained in:
Jake Howard 2015-08-24 22:15:12 +01:00
parent dbab516ae3
commit 91da22e827
2 changed files with 8 additions and 20 deletions

View file

@ -3,24 +3,16 @@ function change_chat_tabs() {
inject_image('._d97', 'emoticon'); inject_image('._d97', 'emoticon');
} }
$('.fbNubFlyout').on('DOMNodeInserted DOMNodeRemoved change load', change_chat_tabs);
jq('.fbNubFlyout').on('DOMNodeInserted DOMNodeRemoved change load', function() { // Something changes inside the chat tab
change_chat_tabs();
}); });
$('._d97').on('change load', change_chat_tabs);
jq('._d97').on('change load', function(){ // Chat Bubble messages
change_chat_tabs();
}); });
$('.fbNub').on('click', change_chat_tabs);
jq('.fbNub').on('click', function() { // Facebook tab button is clicked
change_chat_tabs();
}); });
$('._55ln').on('click', change_chat_tabs);
jq('._55ln').on('click', function() { //Facebook sidebar person is clicked
change_chat_tabs();
}) })
change_chat_tabs(); change_chat_tabs();

View file

@ -5,19 +5,15 @@ function change_comments() {
function change_readme() { function change_readme() {
console.log("readme event"); console.log("readme event");
inject_image('.comment-body'); inject_image('#readme');
} }
$("button.btn[name='comment_and_close']").prev().on('click', change_comments);
$('.js-comment-container').on('load change', change_comments);
jq("button.btn[name='comment_and_close']").prev().on('click', function(){ // When the comment button is clicked
change_comments();
}); });
$('#readme').on('load change', change_readme);
jq('.js-comment-container').on('load change', function(){ // when another comment comes in
change_comments();
});
change_comments(); change_comments();