v-for="id in msgDisplay" | v-for="id in msgDisplay" | ||||
:key="id" | :key="id" | ||||
:msg="messages[id] || {}" | :msg="messages[id] || {}" | ||||
:isBookmark="bookmarkArray[id]" | |||||
></MsgCard> | ></MsgCard> | ||||
</div> | </div> | ||||
messages: _messages, | messages: _messages, | ||||
isActive: true, | isActive: true, | ||||
messageId: '', | messageId: '', | ||||
bookmarkArray: auth.bookmarks, | |||||
} | } | ||||
}, | }, | ||||
computed:{ | computed:{ | ||||
/*var _usrid = auth.user; | /*var _usrid = auth.user; | ||||
$.ajax({ | $.ajax({ | ||||
url: "api/usr/id/" + _usrid, | url: "api/usr/id/" + _usrid, | ||||
console.log(err); | console.log(err); | ||||
}*/ | }*/ | ||||
} | } | ||||
}, | |||||
beforeMount: function(){ | |||||
}, | }, | ||||
mounted: function (){ | mounted: function (){ | ||||
this.getMessages(); | this.getMessages(); | ||||
} | |||||
}, | |||||
}; | }; |
<div> | <div> | ||||
<div id="om-msg-cards" class="column pull-right-sm is-four-fifths-desktop"> | <div id="om-msg-cards" class="column pull-right-sm is-four-fifths-desktop"> | ||||
<a id="escape-search-link" @click="goBackToDashboard">< zurück zu allen Einträgen</a> | <a id="escape-search-link" @click="goBackToDashboard">< zurück zu allen Einträgen</a> | ||||
<b-button id="subscribe-btn" type="is-primary" @click="changeSubscribtion"><div id="btn-text"></div></b-button> | |||||
<b-button id="subscribe-btn" type="is-primary" @click="changeSubscribtion"><div id="btn-text"></div></b-button><br><br> | |||||
<MsgCard | <MsgCard | ||||
v-for="id in messagelist.slice().reverse()" | v-for="id in messagelist.slice().reverse()" | ||||
:key="id" | :key="id" |
_messages = {}, | _messages = {}, | ||||
// Tag | // Tag | ||||
_taglist = ["efi","wichtig"], | |||||
_taglist = [], | |||||
_tags = [], | _tags = [], | ||||
tagArray = [], | tagArray = [], | ||||
<i class="material-icons">account_circle</i> | <i class="material-icons">account_circle</i> | ||||
Erstellt von {{ msg.user }} | Erstellt von {{ msg.user }} | ||||
</div> | </div> | ||||
<i id="bockmark-not-active" class="material-icons" :key="isActive" @click="myFilter(msg._id)" v-if="!isActive">bookmark_border</i> | |||||
<i id="bockmark-active" class="material-icons" :key="isActive" @click="myFilter(msg._id)" v-else>bookmark</i> | |||||
<i id="bockmark-not-active" class="material-icons" :key="vueRender.key" @click="myFilter(msg._id)" v-if="!isActive">bookmark_border</i> | |||||
<i id="bockmark-active" class="material-icons" :key="vueRender.key" @click="myFilter(msg._id)" v-else>bookmark</i> | |||||
</div> | </div> | ||||
</div>`, | </div>`, | ||||
props: ['msg', 'isBookmark'], | props: ['msg', 'isBookmark'], | ||||
data: function () { | data: function () { | ||||
return { | return { | ||||
isActive: this.isBookmark, | isActive: this.isBookmark, | ||||
isActive_: 0, | |||||
msgid: this.msg._id, | msgid: this.msg._id, | ||||
bookmarkArray: auth.bookmarks, | bookmarkArray: auth.bookmarks, | ||||
vueRender: vueRender, | |||||
}; | }; | ||||
}, | }, | ||||
}*/ | }*/ | ||||
}, | }, | ||||
filterForTag: function (tag) { | filterForTag: function (tag) { | ||||
console.log("link: " + tag); | |||||
//console.log("link: " + tag); | |||||
searching(tag); | searching(tag); | ||||
var btnString = "#" + tag + " abonnieren"; | |||||
$("#btn-text").text(btnString); | |||||
$("#subscribe-btn").css("visibility", "visible"); | |||||
}, | }, | ||||
isBookmarkActive: function (msgid) { | isBookmarkActive: function (msgid) { | ||||
//console.log("isBookmarkActive(): " + msgid); | //console.log("isBookmarkActive(): " + msgid); |
function searching(searchtext) { | function searching(searchtext) { | ||||
_isSearchActiv = true; | _isSearchActiv = true; | ||||
$("#escape-search-link").css("visibility", "visible"); | $("#escape-search-link").css("visibility", "visible"); | ||||
if(_taglist.indexOf(searchtext.replace(/#/g, '')) > -1){ | |||||
//console.log(_tags); | |||||
console.log(data); | |||||
if(data.indexOf(searchtext) > -1){ | |||||
var btnString = "#" + searchtext.replace(/#/g, '') + " abonnieren"; | var btnString = "#" + searchtext.replace(/#/g, '') + " abonnieren"; | ||||
$("#btn-text").text(btnString); | $("#btn-text").text(btnString); | ||||
$("#subscribe-btn").css("visibility", "visible"); | $("#subscribe-btn").css("visibility", "visible"); |