Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
Fixes bug to make site work even if there's an ad block-like plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
matias-mi committed May 8, 2015
1 parent fc70766 commit a060686
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions app/assets/js/SendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,21 @@ ppar.SendMessage = function (container, legislatives, options) {
}
});

twttr.events.bind('click', function (event) {
var id;
if (event) {
id = jQuery(event.target).attr("id");
currentLegislativeId = parseInt(id.substr(id.indexOf("-") + 1), 10);
}
});
if (window.twttr) {
twttr.events.bind('click', function (event) {
var id;
if (event) {
id = jQuery(event.target).attr("id");
currentLegislativeId = parseInt(id.substr(id.indexOf("-") + 1), 10);
}
});

twttr.events.bind('tweet', function (event) {
if (event) {
registerActivity("tweet");
}
});
twttr.events.bind('tweet', function (event) {
if (event) {
registerActivity("tweet");
}
});
}

container.find(".js-fb-feed").click(function (event) {
var link = jQuery(event.target);
Expand Down

0 comments on commit a060686

Please sign in to comment.