Adding operation number to create a unique href for the <a/> tag.
This commit is contained in:
@@ -4,11 +4,18 @@ class ResourceView extends Backbone.View
|
||||
render: ->
|
||||
$(@el).html(Handlebars.templates.resource(@model))
|
||||
|
||||
@number = 0
|
||||
|
||||
# Render each operation
|
||||
@addOperation operation for operation in @model.operationsArray
|
||||
@
|
||||
|
||||
addOperation: (operation) ->
|
||||
|
||||
operation.number = @number
|
||||
|
||||
# Render an operation and add it to operations li
|
||||
operationView = new OperationView({model: operation, tagName: 'li', className: 'endpoint'})
|
||||
$('.endpoints', $(@el)).append operationView.render().el
|
||||
$('.endpoints', $(@el)).append operationView.render().el
|
||||
|
||||
@number++
|
||||
|
||||
Reference in New Issue
Block a user