search for tags / normal text search not working
This commit is contained in:
parent
ab358abe98
commit
d48a3bf5ed
@ -97,7 +97,7 @@
|
||||
<div class="om-header-container">
|
||||
<div class="om-header">
|
||||
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
|
||||
<form class="om-searchbar" @submit.prevent="search()">
|
||||
<form class="om-searchbar" @submit.prevent="search">
|
||||
<b-field>
|
||||
<b-taginput
|
||||
id="search-text"
|
||||
@ -168,7 +168,7 @@
|
||||
|
||||
<script>
|
||||
var tagArray = [];
|
||||
const data=[
|
||||
const dat=[
|
||||
'th',
|
||||
'efi',
|
||||
'wichtig',
|
||||
@ -216,7 +216,7 @@
|
||||
})
|
||||
},
|
||||
getFilteredTags(text) {
|
||||
this.taglist = data.filter((option) => {
|
||||
this.taglist = dat.filter((option) => {
|
||||
return option
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
@ -227,19 +227,37 @@
|
||||
tagArray = this.selected;
|
||||
console.info(tagArray);
|
||||
},
|
||||
list_tags: function () {
|
||||
$.ajax({url: "api/tag/ids",method: "GET"})
|
||||
.done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
_taglist.splice(0, _taglist.length);
|
||||
_taglist.push.apply(_taglist, jd);
|
||||
console.log("tag: jd: " + jd);
|
||||
for (var e in jd) {
|
||||
if (!_tags[jd[e]]) {
|
||||
get_insert_tag(jd[e]);
|
||||
}
|
||||
}
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("err: " + e + f + g);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
mounted: function () {
|
||||
//this.search();
|
||||
this.list_tags();
|
||||
},
|
||||
});
|
||||
function get_insert_tag(id){
|
||||
$.ajax({ url: "api/tag/"+id, method: "GET" }).done(function (tag) {
|
||||
data.push("#"+tag.name);
|
||||
dat.push("#"+tag.name);
|
||||
console.log("it worked!");
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
//this.search();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user