Button und Link für die Suche

This commit is contained in:
Xenia Gruenzinger 2019-07-22 18:40:51 +02:00
parent 3550f1558b
commit 6eb741760f
4 changed files with 28 additions and 9 deletions

@ -2,6 +2,8 @@ const HomeRouter = {
template: `
<div>
<div id="om-msg-cards" class="is-hidden-desktop">
<a v-if="isSearchActiv" @click="goBackToDashboard">< zurück zu allen Einträgen</a>
<b-button class="subscribe-btn" v-if="isSubscripeButtonActiv" type="is-primary" @click="">#IPSUM ABONNIEREN</b-button>
<MsgCard
v-for="id in messagelist.slice().reverse()"
:key="id"
@ -10,6 +12,8 @@ const HomeRouter = {
</div>
<div id="om-msg-cards" class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
<a v-if="isSearchActiv" @click="goBackToDashboard">< zurück zu allen Einträgen</a>
<b-button class="subscribe-btn" v-if="isSubscripeButtonActiv" type="is-primary" @click="">#IPSUM ABONNIEREN</b-button>
<MsgCard
v-for="id in messagelist.slice().reverse()"
:key="id"
@ -21,14 +25,21 @@ const HomeRouter = {
return {
messagelist: _messagelist,
messages: _messages,
isSearchActiv: _isSearchActiv,
isSubscripeButtonActiv: _isSubscripeButtonActiv
};
},
methods: {
list_messages: function() {
messages();
}
},
},
goBackToDashboard: function() {
//Home neu rendern ...
//windows.history.go();
_isSearchActiv = false;
}
},
mounted: function () {
this.list_messages();
//this.refresh_messages();

@ -8,11 +8,14 @@ var auth = {},
_messages = {},
// Tag
_taglist = [],
_taglist = ["efi","wichtig"],
_tags = [],
tagArray = [],
// Search
isSearchActive = false,
_isSearchActiv = false,
_isSubscripeButtonActiv = false,
data = [],
search_data = [];
search_data = []

@ -69,9 +69,7 @@ Vue.component('search',{
});
},
clear: function() {
console.log("clear");
isSearchActiv = false;
_isSearchActiv = false;
this.searchtext = "";
this.list_messages();
},
@ -95,7 +93,7 @@ function get_insert_tag(id) {
}
function searching(searchtext) {
isSearchActiv = true;
_isSearchActiv = true;
console.log("Searchtext: " + searchtext.replace(/#/g, ''));
$.ajax({
url: "api/msg/search/" + searchtext.replace(/#/g, ''),
@ -113,6 +111,9 @@ function searching(searchtext) {
}).fail(function(e, f, g) {
console.log("searching: err: " + e + f + g);
})
_isSubscripeButtonActiv = (_taglist.indexOf(searchtext.replace(/#/g, '')) > -1);
console.log("isSubscripeButtonActiv: " + _isSubscripeButtonActiv);
}
function messages() {

@ -241,3 +241,7 @@ button.clearButton {
float: right;
}
}
.subscribe-btn{
float:right;
}