2018-06-08 14:24:17 +02:00
|
|
|
exports.initialize = function () {
|
|
|
|
if (!page_params.search_pills_enabled) {
|
|
|
|
return;
|
|
|
|
}
|
2019-11-02 00:06:25 +01:00
|
|
|
const 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 () {
|
2019-11-02 00:06:25 +01:00
|
|
|
const base_query = search_pill.get_search_string_for_current_filter(exports.widget);
|
|
|
|
const operators = Filter.parse(base_query);
|
2018-07-14 16:10:00 +02:00
|
|
|
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;
|