1
0
Fork 0
mirror of synced 2024-07-04 22:20:45 +12:00
appwrite/public/scripts/views/forms/document.js

26 lines
651 B
JavaScript
Raw Normal View History

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);