Commit e67a4837 authored by Luke Bennett's avatar Luke Bennett

Fixed project filtering

parent 0ccdb41c
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
Todos.prototype.initFilters = function() { Todos.prototype.initFilters = function() {
new UsersSelect(); new UsersSelect();
this.initFilterDropdown($('.js-project-search'), 'project_id', true); this.initFilterDropdown($('.js-project-search'), 'project_id', ['text']);
this.initFilterDropdown($('.js-type-search'), 'type'); this.initFilterDropdown($('.js-type-search'), 'type');
this.initFilterDropdown($('.js-action-search'), 'action_id'); this.initFilterDropdown($('.js-action-search'), 'action_id');
...@@ -40,11 +40,12 @@ ...@@ -40,11 +40,12 @@
}); });
}; };
Todos.prototype.initFilterDropdown = function($dropdown, fieldName, isFilterable) { Todos.prototype.initFilterDropdown = function($dropdown, fieldName, searchFields) {
$dropdown.glDropdown({ $dropdown.glDropdown({
selectable: true, selectable: true,
filterable: isFilterable, filterable: searchFields ? true : false,
fieldName: fieldName, fieldName: fieldName,
search: { fields: searchFields },
data: $dropdown.data('data'), data: $dropdown.data('data'),
clicked: function() { clicked: function() {
return $dropdown.closest('form.filter-form').submit(); return $dropdown.closest('form.filter-form').submit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment