2020-05-03 07:57:52 +12:00
|
|
|
(function(window) {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
window.ls.container.get("view").add({
|
|
|
|
selector: "data-forms-document",
|
|
|
|
controller: function(element, container, search) {
|
2020-05-03 21:49:22 +12:00
|
|
|
var formsDocument = (element.dataset["formsDocument"] || '');
|
2020-05-03 07:57:52 +12:00
|
|
|
var searchButton = (element.dataset["search"] || 0);
|
|
|
|
|
2020-05-03 21:49:22 +12:00
|
|
|
let path = container.scope(searchButton);
|
2020-05-03 07:57:52 +12:00
|
|
|
|
2020-05-03 21:49:22 +12:00
|
|
|
element.addEventListener('click', function() {
|
|
|
|
search.selected = element.value;
|
|
|
|
search.path = path;
|
2020-05-03 07:57:52 +12:00
|
|
|
|
2020-05-03 21:49:22 +12:00
|
|
|
document.dispatchEvent(
|
|
|
|
new CustomEvent(formsDocument, {
|
|
|
|
bubbles: false,
|
|
|
|
cancelable: true
|
|
|
|
}));
|
|
|
|
});
|
2020-05-03 07:57:52 +12:00
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})(window);
|