Skip to content

Commit

Permalink
fixes shoutbox is rendered twice on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlaefer committed Aug 14, 2013
1 parent 1511b96 commit eb714b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/webroot/js/main-prod.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion app/webroot/js/views/shouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ define([

var ShoutboxView = Backbone.View.extend({

isPrerendered: true,

events: {
"keyup form": "formUp",
"keydown form": "formDown"
Expand Down Expand Up @@ -60,7 +62,11 @@ define([
},

render: function(data) {
$(this.shouts).html(this.model.get('html'));
if (this.isPrerendered) {
this.isPrerendered = false;
} else {
$(this.shouts).html(this.model.get('html'));
}
return this;
}

Expand Down

0 comments on commit eb714b8

Please sign in to comment.