2018-06-08 10:16:04 +02:00
|
|
|
var search_pill_widget = (function () {
|
|
|
|
|
|
|
|
var exports = {};
|
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
|
|
|
};
|
|
|
|
|
2018-06-08 10:16:04 +02:00
|
|
|
return exports;
|
|
|
|
}());
|
|
|
|
|
|
|
|
if (typeof module !== 'undefined') {
|
|
|
|
module.exports = search_pill_widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
window.search_pill_widget = search_pill_widget;
|