Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2d22b87d64
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (25 sloc) 0.888 kb
RailsBackboneRelational.Views.Comments ||= {}
class RailsBackboneRelational.Views.Comments.IndexView extends Backbone.View
template: JST["backbone/templates/comments/index"]
initialize: () ->
#alert('options: ' + @options.ofer_length)
@num = @options.ofer_length
#@options.comments.each(@update_span(num))
@options.comments.bind('reset', @addAll)
#update_span: (num) =>
#alert(num)
addAll: () =>
@options.comments.each(@addOne)
addOne: (comment) =>
abcd =
model : comment
view = new RailsBackboneRelational.Views.Comments.CommentView(abcd)
alert(view.el.className)
inta = parseInt(12/@num)
view.el.className = "span" + inta
alert(view.el.className)
@$(".comments-list").append(view.render().el)
render: =>
$(@el).html(@template(comments: @options.comments.toJSON() ))
@addAll()
return this
Jump to Line
Something went wrong with that request. Please try again.