Skip to content

Commit

Permalink
tracking down the issues with how I'm appending table rows
Browse files Browse the repository at this point in the history
  • Loading branch information
abelmartin committed May 3, 2012
1 parent 58f4d5b commit d09aaed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.DS_Store
my_api_key.rb
Session.vim
.idea/
3 changes: 1 addition & 2 deletions public/javascripts/app/collections/movies.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ var Movies = Backbone.Collection.extend({
this.sort_man = new SortManager();
this.comparator = function(film){
if (film){
var tt = that.sort_man.comp_value(film);
return tt;
return that.sort_man.comp_value(film);
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion public/javascripts/app/models/movie.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var Movie = Backbone.Model.extend({
defaults: {
comment_count: 0,
show_details: false
show_details: false,
v_counter: 0
},

freshness_class: function(){
Expand Down
10 changes: 6 additions & 4 deletions public/javascripts/app/views/movie_table_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var MovieTableRowView = Backbone.View.extend({
template: $("#TMPMovieRows").html(),

initialize: function(){
_.bindAll(this,
'render',
_.bindAll(this,
'render',
'setMovieDetailState',
'openMovieDetails');
// this.model.bind('all', this.render);
Expand All @@ -16,12 +16,14 @@ var MovieTableRowView = Backbone.View.extend({
return this;
},

events:{
events:{
"click a.display_comments" : "setMovieDetailState"
},

openMovieDetails: function(){
COTM.logEvent("Would have opened the detail view");
var vc = this.model.get("v_counter");
COTM.logEvent("Would have opened the detail view. VC:" + vc);
this.model.set({show_details:false, v_counter: vc + 1}, {silent:true});
},

setMovieDetailState: function(e){
Expand Down

0 comments on commit d09aaed

Please sign in to comment.