Skip to content

Commit

Permalink
Update for #501
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Biggs committed Oct 16, 2013
1 parent f202873 commit 287e239
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions lib/list.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Spine.List extends Spine.Controller
@bind 'change', @change

template: ->
throw 'Override template'
throw Error 'Override template'

change: (item) =>
@current = item
Expand All @@ -22,8 +22,9 @@ class Spine.List extends Spine.Controller
return

@children().removeClass('active')
for item, idx in @items
index = idx if item is @current
for item, idx in @items when item is @current
index = idx
break

$(@children().get(index)).addClass('active')

Expand All @@ -43,4 +44,4 @@ class Spine.List extends Spine.Controller
@trigger('change', item)
true

module?.exports = Spine.List
module?.exports = Spine.List

0 comments on commit 287e239

Please sign in to comment.