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

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"
</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"
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();

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

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



+ 5
- 4
public/search.js View File

}); });
}, },
clear: function() { clear: function() {
console.log("clear");

isSearchActiv = false;
_isSearchActiv = false;
this.searchtext = ""; this.searchtext = "";
this.list_messages(); this.list_messages();
}, },
} }


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, ''),
}).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() {

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

float: right; float: right;
} }
} }

.subscribe-btn{
float:right;
}

Loading…
Cancel
Save