Skip to content
Snippets Groups Projects
Commit 8a3c6f51 authored by bbaer's avatar bbaer
Browse files

expanded commands

parent 9d44e70b
No related branches found
No related tags found
No related merge requests found
Pipeline #1454 passed
......@@ -85,18 +85,42 @@ var QfqNS = QfqNS || {};
var $commentCommands = $("<div />", {
class: "qfqCommentCommands"
});
$commentCommands.append(this._getCommand("Edit", "pencil"));
$commentCommands.append(this._getCommand("Delete", "trash"));
$commentCommands.append(this._getCommand("Reply", "comment"));
var that = this;
$commentCommands.append(this._getCommand("Edit", "pencil", function(e) {
that._editMe(e);
}));
$commentCommands.append(this._getCommand("Delete", "trash", function(e) {
that._deleteMe(e);
}));
$commentCommands.append(this._getCommand("Reply", "comment", function(e) {
that._replyToMe(e);
}));
return $commentCommands;
};
n.Comment.prototype._getCommand = function(description, icon) {
n.Comment.prototype._getCommand = function(description, icon, onClick) {
var $command = $('<span />', {
class: "glyphicon glyphicon-" + icon + " qfqCommentCommand",
title: description
});
$command.bind("click", this, onClick);
return $command;
};
n.Comment.prototype._deleteMe = function(e) {
console.log("Delete pressed for:");
console.log(this.comment);
};
n.Comment.prototype._editMe = function(e) {
console.log("Edit pressed for:");
console.log(this.comment);
};
n.Comment.prototype._replyToMe = function(e) {
console.log("Reply to me:");
console.log(this.comment);
console.log(e);
};
})(QfqNS);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment