2018-06-08 14:24:17 +02:00
|
|
|
exports.initialize = function () {
|
|
|
|
if (!page_params.search_pills_enabled) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var container = $('#search_arrows');
|
2018-07-23 02:20:57 +02:00
|
|
|
exports.widget = search_pill.create_pills(container);
|
2018-07-14 16:10:00 +02:00
|
|
|
|
2018-07-23 02:20:57 +02:00
|
|
|
exports.widget.onPillRemove(function () {
|
|
|
|
var base_query = search_pill.get_search_string_for_current_filter(exports.widget);
|
2018-07-14 16:10:00 +02:00
|
|
|
var operators = Filter.parse(base_query);
|
|
|
|
narrow.activate(operators, {trigger: 'search'});
|
|
|
|
});
|
2018-06-08 14:24:17 +02:00
|
|
|
};
|
|
|
|
|
2019-10-25 09:45:13 +02:00
|
|
|
window.search_pill_widget = exports;
|