Skip to content

Commit

Permalink
Update search.js for charcoal-core 0.3
Browse files Browse the repository at this point in the history
To use conjoined filters as search query.
  • Loading branch information
mcaskill committed Nov 22, 2017
1 parent 8925996 commit 0b47a55
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
12 changes: 8 additions & 4 deletions assets/dist/scripts/charcoal.admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3558,7 +3558,7 @@ Charcoal.Admin.Widget_Search.prototype.dispatch = function (widget)
widget.pagination.page = 1;
}

var $input, words, props, filters = [];
var $input, words, props, query, filters = [];

$input = this.element().find('input');
words = $input.val().split(/\s/);
Expand All @@ -3569,13 +3569,17 @@ Charcoal.Admin.Widget_Search.prototype.dispatch = function (widget)
filters.push({
property: prop,
operator: 'LIKE',
value: ('%' + word + '%'),
operand: 'OR'
value: ('%' + word + '%')
});
});
});

widget.set_filters(filters);
query = {
conjunction: 'OR',
filters: filters
};

widget.set_filters([ query ]);

// widget.add_search(val, props);

Expand Down
Loading

0 comments on commit 0b47a55

Please sign in to comment.