Skip to content

Commit

Permalink
only do the badge once
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Sofaer committed Jan 16, 2012
1 parent 10b4cbd commit aeba421
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/javascripts/stop_censorship.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ CloudFlare.define(
.bind("click", function(){ self.inspirationalDialog() })
},
placeBadge : function(){
$("body").append(this.badge())
if(!$("body").find(".sopa_badge").length) {
$("body").append(this.badge())
}
},

tweetWindow : function(options) {
Expand Down
5 changes: 5 additions & 0 deletions spec/javascripts/stop_censorship_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ describe("#sopafy", function(){
it("should create a reminder badge", function(){
expect($(".sopa_badge").length).toBe(1);
})
it("should create a reminder badge only once", function(){
this.target.sopafy()
expect($(".sopa_badge").length).toBe(1);
})


it("should not wrap text in an achor", function() {
var sopaElementsInAnchor = this.target.eq(1).find('.sopafied')
Expand Down

0 comments on commit aeba421

Please sign in to comment.