Skip to content

Commit

Permalink
QUICK-FIX fix selectable logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jawsthegame committed Sep 24, 2013
1 parent 8b2c51f commit 630e3de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/views/list_view.coffee
Expand Up @@ -7,7 +7,7 @@ class RowView extends View
events:
'click': '_selected'

constructor: (@model, @template) ->
constructor: (@model, @template, @opts) ->
super(id: @model.id)

@model.on 'change', @render, this
Expand All @@ -24,8 +24,9 @@ class RowView extends View
@$el.addClass('hidden')

_selected: ->
@highlight()
@trigger 'select', @model
unless @opts?.unselectable
@highlight()
@trigger 'select', @model


class ListView extends View
Expand Down Expand Up @@ -58,8 +59,7 @@ class ListView extends View
@_reset()

select: (item) ->
selectable = @opts?.selectable or true
if selectable
unless @opts?.unselectable
@rows[item.id]?.highlight()
@selectedItem = item

Expand Down Expand Up @@ -101,7 +101,7 @@ class ListView extends View

_addItem: (item) ->
rowClass = @rowClass or RowView
row = new rowClass(item, @template).render()
row = new rowClass(item, @template, @opts).render()
@rows[item.id] = row
@append(row, @listEl())
row.on('select', ((model) =>
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "quips",
"version": "0.2.13",
"version": "0.2.14",
"dependencies": {
"coffee-script": "1.6.x",
"jqueryify": "1.9.1",
Expand Down

0 comments on commit 630e3de

Please sign in to comment.