2021-02-28 01:28:13 +01:00
|
|
|
import * as hashchange from "./hashchange";
|
|
|
|
import * as search_pill from "./search_pill";
|
2020-08-01 03:43:15 +02:00
|
|
|
|
2021-02-28 01:28:13 +01:00
|
|
|
export let widget;
|
2021-02-10 17:09:55 +01:00
|
|
|
|
2021-02-28 01:28:13 +01:00
|
|
|
export function initialize() {
|
2018-06-08 14:24:17 +02:00
|
|
|
if (!page_params.search_pills_enabled) {
|
|
|
|
return;
|
|
|
|
}
|
2020-07-15 01:29:15 +02:00
|
|
|
const container = $("#search_arrows");
|
2021-02-28 01:28:13 +01:00
|
|
|
widget = search_pill.create_pills(container);
|
2018-07-14 16:10:00 +02:00
|
|
|
|
2021-02-28 01:28:13 +01:00
|
|
|
widget.onPillRemove(() => {
|
|
|
|
if (widget.items().length === 0) {
|
2020-07-03 10:38:24 +02:00
|
|
|
hashchange.go_to_location("");
|
2020-06-17 16:24:11 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-02-28 01:28:13 +01:00
|
|
|
widget.createPillonPaste(() => false);
|
|
|
|
}
|