Skip to content

Commit

Permalink
Merge pull request #97 from sandersky/master
Browse files Browse the repository at this point in the history
Play nice with POJO's
  • Loading branch information
sandersky committed Jan 27, 2017
2 parents 13e1da3 + 61b41e9 commit 584fb94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addon/helpers/is-lead-selection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember'
const {Helper} = Ember
const {Helper, get} = Ember

/**
* Determine if an item is the lead selection in a set of selections
Expand All @@ -8,7 +8,7 @@ const {Helper} = Ember
* @returns {boolean} - true if the item is the lead selection
*/
export function selectionPosition ([items, item]) {
if (!item.get('isSelected')) {
if (!get(item, 'isSelected')) {
return false
}

Expand All @@ -17,7 +17,7 @@ export function selectionPosition ([items, item]) {
return true
}

const isPreviousItemSelected = items.get(itemIndex - 1).get('isSelected')
const isPreviousItemSelected = get(items, `${itemIndex - 1}.isSelected`)
return !isPreviousItemSelected
}

Expand Down

0 comments on commit 584fb94

Please sign in to comment.