Browse Source

Button und Link für die Suche

master
Xenia Gruenzinger 5 years ago
parent
commit
6eb741760f
4 changed files with 28 additions and 9 deletions
  1. 13
    2
      public/routes/home.js
  2. 6
    3
      public/routes/initGlobals.js
  3. 5
    4
      public/search.js
  4. 4
    0
      public/style/style.css

+ 13
- 2
public/routes/home.js View File

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

+ 6
- 3
public/routes/initGlobals.js View File

@@ -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 = []



+ 5
- 4
public/search.js View File

@@ -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() {

+ 4
- 0
public/style/style.css View File

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

.subscribe-btn{
float:right;
}

Loading…
Cancel
Save