Button und Link für die Suche
This commit is contained in:
parent
3550f1558b
commit
6eb741760f
public
@ -2,6 +2,8 @@ const HomeRouter = {
|
|||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<div id="om-msg-cards" class="is-hidden-desktop">
|
<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
|
<MsgCard
|
||||||
v-for="id in messagelist.slice().reverse()"
|
v-for="id in messagelist.slice().reverse()"
|
||||||
:key="id"
|
:key="id"
|
||||||
@ -10,6 +12,8 @@ const HomeRouter = {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="om-msg-cards" class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
|
<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
|
<MsgCard
|
||||||
v-for="id in messagelist.slice().reverse()"
|
v-for="id in messagelist.slice().reverse()"
|
||||||
:key="id"
|
:key="id"
|
||||||
@ -21,14 +25,21 @@ const HomeRouter = {
|
|||||||
return {
|
return {
|
||||||
messagelist: _messagelist,
|
messagelist: _messagelist,
|
||||||
messages: _messages,
|
messages: _messages,
|
||||||
|
isSearchActiv: _isSearchActiv,
|
||||||
|
isSubscripeButtonActiv: _isSubscripeButtonActiv
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
list_messages: function() {
|
list_messages: function() {
|
||||||
messages();
|
messages();
|
||||||
}
|
},
|
||||||
},
|
goBackToDashboard: function() {
|
||||||
|
//Home neu rendern ...
|
||||||
|
//windows.history.go();
|
||||||
|
|
||||||
|
_isSearchActiv = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.list_messages();
|
this.list_messages();
|
||||||
//this.refresh_messages();
|
//this.refresh_messages();
|
||||||
|
@ -8,11 +8,14 @@ var auth = {},
|
|||||||
_messages = {},
|
_messages = {},
|
||||||
|
|
||||||
// Tag
|
// Tag
|
||||||
_taglist = [],
|
_taglist = ["efi","wichtig"],
|
||||||
_tags = [],
|
_tags = [],
|
||||||
tagArray = [],
|
tagArray = [],
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
isSearchActive = false,
|
_isSearchActiv = false,
|
||||||
|
_isSubscripeButtonActiv = false,
|
||||||
data = [],
|
data = [],
|
||||||
search_data = [];
|
search_data = []
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,9 +69,7 @@ Vue.component('search',{
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
clear: function() {
|
clear: function() {
|
||||||
console.log("clear");
|
_isSearchActiv = false;
|
||||||
|
|
||||||
isSearchActiv = false;
|
|
||||||
this.searchtext = "";
|
this.searchtext = "";
|
||||||
this.list_messages();
|
this.list_messages();
|
||||||
},
|
},
|
||||||
@ -95,7 +93,7 @@ function get_insert_tag(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function searching(searchtext) {
|
function searching(searchtext) {
|
||||||
isSearchActiv = true;
|
_isSearchActiv = true;
|
||||||
console.log("Searchtext: " + searchtext.replace(/#/g, ''));
|
console.log("Searchtext: " + searchtext.replace(/#/g, ''));
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "api/msg/search/" + searchtext.replace(/#/g, ''),
|
url: "api/msg/search/" + searchtext.replace(/#/g, ''),
|
||||||
@ -113,6 +111,9 @@ function searching(searchtext) {
|
|||||||
}).fail(function(e, f, g) {
|
}).fail(function(e, f, g) {
|
||||||
console.log("searching: err: " + e + f + g);
|
console.log("searching: err: " + e + f + g);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
_isSubscripeButtonActiv = (_taglist.indexOf(searchtext.replace(/#/g, '')) > -1);
|
||||||
|
console.log("isSubscripeButtonActiv: " + _isSubscripeButtonActiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
function messages() {
|
function messages() {
|
||||||
|
@ -241,3 +241,7 @@ button.clearButton {
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.subscribe-btn{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user