Made it so edit will only be displayed for the user. Since its on client side (following practices used) a final check should be used when actually saving edit to db

This commit is contained in:
MrRenter
2015-04-17 22:36:09 -04:00
parent c711b41fa0
commit 47bb301a91

View File

@ -22,8 +22,10 @@
commentDetails = data;
var div = document.createElement('div');
var editButton = "";
if ((Date.now() - commentDetails.commentOn) < 600000){
editButton = "<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' id='test-" + commentDetails._id + "'>Edit</a> · ";
if (commentDetails.author.username === user.profile.username){
if ((Date.now() - commentDetails.commentOn) < 600000){
editButton = "<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' id='test-" + commentDetails._id + "'>Edit</a> · ";
}
}
$(div)
.html(