Make the first found item to be automatically selected

This is a regression caused by docquery integration (56821bccbc). indexof always returns -1. Since the selected item is always the first filtered item, we can safely set it to 1.
This commit is contained in:
Seongjae Lee
2015-09-11 22:43:09 -07:00
parent 4dd0b518aa
commit 09d0efc06f
+1 -2
View File
@@ -136,8 +136,7 @@ class NotationalVelocityView extends SelectListView
@list.append(itemView)
if selectedItem
n = filteredItems.indexOf(selectedItem) + 1
@selectItemView(@list.find("li:nth-child(#{n})"))
@selectItemView(@list.find("li:nth-child(#{1})"))
else
@setError(@getEmptyMessage(@docQuery.documents.length, filteredItems.length))