2019-04-15 08:54:11 +03:00
|
|
|
/* exported SearchInput */
|
|
|
|
/* globals SearchService: true */
|
|
|
|
/* globals SearchStore: true */
|
2019-04-14 20:17:43 +03:00
|
|
|
|
|
|
|
var SearchInput = {
|
|
|
|
view: function(){
|
|
|
|
function handleInput(e){
|
2019-04-15 08:54:11 +03:00
|
|
|
SearchService.search(e.target.value);
|
2019-04-14 20:17:43 +03:00
|
|
|
}
|
|
|
|
|
2019-04-14 20:51:31 +03:00
|
|
|
return m("div", { class: "input-group mb-3" }, [
|
|
|
|
m("div", { class: "input-group-prepend" }, [
|
|
|
|
m("span", { class: "input-group-text" }, [
|
|
|
|
m("i", { class: "fa fa-search"})
|
|
|
|
])
|
|
|
|
]),
|
2019-04-15 08:54:11 +03:00
|
|
|
m("input[type=text]", {
|
|
|
|
placeholder: "Search",
|
|
|
|
class: "form-control",
|
|
|
|
oninput: handleInput,
|
|
|
|
value: SearchStore.query
|
|
|
|
})
|
2019-04-14 20:51:31 +03:00
|
|
|
]);
|
2019-04-14 20:17:43 +03:00
|
|
|
}
|
2019-04-15 08:54:11 +03:00
|
|
|
};
|