|
|
|
|
|
|
|
|
template: `<div class="om-card card"> |
|
|
template: `<div class="om-card card"> |
|
|
<h6 class="msg-head"> |
|
|
<h6 class="msg-head"> |
|
|
<b>{{ msg.subject }}</b> |
|
|
<b>{{ msg.subject }}</b> |
|
|
<div id="msgid">{{msg._id}}</div> |
|
|
|
|
|
|
|
|
<div id="msgid" >{{msg._id}}</div> |
|
|
<img src="favicon.ico" width=20px height=20px> |
|
|
<img src="favicon.ico" width=20px height=20px> |
|
|
</h6> |
|
|
</h6> |
|
|
{{ msg.message }}<br> |
|
|
{{ msg.message }}<br> |
|
|
|
|
|
|
|
|
<div class="om-card-footer"> <div class="om-user-line"> |
|
|
<div class="om-card-footer"> <div class="om-user-line"> |
|
|
<i class="material-icons">account_circle</i> |
|
|
<i class="material-icons">account_circle</i> |
|
|
Erstellt von {{ msg.user }}</div> |
|
|
Erstellt von {{ msg.user }}</div> |
|
|
<i class="material-icons" @click="myFilter(msg._id)" v-if="!isActive">bookmark_border</i> |
|
|
|
|
|
<i class="material-icons" @click="myFilter(msg._id)" v-else="isActive">bookmark</i> |
|
|
|
|
|
|
|
|
<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> |
|
|
</div></div>`, |
|
|
</div></div>`, |
|
|
props: ['msg'], |
|
|
|
|
|
|
|
|
props: ['msg', 'isBookmark'], |
|
|
|
|
|
|
|
|
data: function () { |
|
|
data: function () { |
|
|
return { |
|
|
return { |
|
|
isActive: false, |
|
|
|
|
|
|
|
|
isActive: this.isBookmark, |
|
|
|
|
|
isActive_: 0, |
|
|
|
|
|
msgid: this.msg._id |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
myFilter: function(_messageid) { |
|
|
|
|
|
|
|
|
myFilter: function (_messageid) { |
|
|
//var _messageid = $("#msgid").text(); |
|
|
//var _messageid = $("#msgid").text(); |
|
|
|
|
|
if (this.isActive == true) { |
|
|
|
|
|
var index = auth.bookmarks.indexOf(_messageid); |
|
|
|
|
|
|
|
|
var _bookmark = auth.bookmarks; |
|
|
|
|
|
_bookmark.push(_messageid); |
|
|
|
|
|
console.log("msgid"+_bookmark); |
|
|
|
|
|
var _userid = "5d360f06b8f3ce67d12ccc92"; |
|
|
|
|
|
|
|
|
if (index > -1) { |
|
|
|
|
|
auth.bookmarks.splice(index, 1); |
|
|
|
|
|
} |
|
|
|
|
|
this.isActive = false; |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log("_messsageid: "+_messageid+" bookmarks: "+auth.bookmarks); |
|
|
|
|
|
auth.bookmarks.push(_messageid); |
|
|
|
|
|
this.isActive =true; |
|
|
|
|
|
} |
|
|
|
|
|
/*console.log("msgid"+_bookmark); |
|
|
|
|
|
var _userid = auth.user; |
|
|
this.isActive = !this.isActive; |
|
|
this.isActive = !this.isActive; |
|
|
if(this.isActive){ |
|
|
if(this.isActive){ |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
|
|
|
|
|
|
console.log("error: " + err.responseText); |
|
|
console.log("error: " + err.responseText); |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
}, |
|
|
}, |
|
|
filterForTag: function(tag) { |
|
|
|
|
|
console.log("link: " +tag); |
|
|
|
|
|
|
|
|
filterForTag: function (tag) { |
|
|
|
|
|
console.log("link: " + tag); |
|
|
searching(tag); |
|
|
searching(tag); |
|
|
}, |
|
|
}, |
|
|
|
|
|
isBookmarkActive: function (msgid) { |
|
|
|
|
|
//console.log("isBookmarkActive(): " + msgid); |
|
|
|
|
|
if (auth.bookmarks.indexOf(msgid) > -1) { |
|
|
|
|
|
// $("#bockmark-not-active").css("visibility","hidden"); |
|
|
|
|
|
// $("#bockmark-active").css("visibility","visible"); |
|
|
|
|
|
this.isActive = true; |
|
|
|
|
|
//console.log("isBookmarkActive(): " + this.isActive); |
|
|
|
|
|
this.isActive_ = 1; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
beforeMount: function () { |
|
|
|
|
|
//this.isBookmarkActive(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |