Permalink
Browse files

fix(js): bind to correct element for inline comment edit

fixes #10501
  • Loading branch information...
jdalsem committed Oct 31, 2016
1 parent 51d0af2 commit e15cba9db569d7f3b0cc5e8982757cd04b67942d
Showing with 4 additions and 3 deletions.
  1. +4 −3 js/lib/comments.js
View
@@ -3,11 +3,12 @@ elgg.provide('elgg.comments');
/**
* @param {Number} guid
* @param {jQuery} item
* @constructor
*/
elgg.comments.Comment = function (guid) {
elgg.comments.Comment = function (guid, item) {
this.guid = guid;
this.$item = $('#elgg-object-' + guid);
this.$item = item;
};
elgg.comments.Comment.prototype = {
@@ -121,7 +122,7 @@ elgg.comments.init = function() {
guid;
if (!dc) {
guid = this.href.split('/').pop();
dc = new elgg.comments.Comment(guid);
dc = new elgg.comments.Comment(guid, $(this).closest('.elgg-item-object-comment'));
$(this).data('Comment', dc);
}
dc.toggleEdit();

0 comments on commit e15cba9

Please sign in to comment.