diff --git a/core/modules/tracker/js/tracker-history.js b/core/modules/tracker/js/tracker-history.js index 877a9ca..6a13eaf 100644 --- a/core/modules/tracker/js/tracker-history.js +++ b/core/modules/tracker/js/tracker-history.js @@ -37,12 +37,13 @@ .once('history') .filter(function () { var lastCommentTimestamp = parseInt(this.getAttribute('data-history-node-last-comment-timestamp'), 10); - var nodeTimestamp = parseInt(this.previousSibling.previousSibling.getAttribute('data-history-node-timestamp'), 10); + var $nodeCell = $(this).siblings().filter('[data-history-node-id]'); + var nodeTimestamp = parseInt($nodeCell.data('history-node-timestamp'), 10); // Discard placeholders that have zero comments. if (lastCommentTimestamp === nodeTimestamp) { return false; } - var nodeID = this.previousSibling.previousSibling.getAttribute('data-history-node-id'); + var nodeID = $nodeCell.data('history-node-id'); if (Drupal.history.needsServerCheck(nodeID, lastCommentTimestamp)) { if (nodeIDs.indexOf(nodeID) === -1) { nodeIDs.push(nodeID); @@ -87,7 +88,8 @@ var placeholdersToUpdate = {}; $placeholders.each(function (index, placeholder) { var timestamp = parseInt(placeholder.getAttribute('data-history-node-last-comment-timestamp'), 10); - var nodeID = placeholder.previousSibling.previousSibling.getAttribute('data-history-node-id'); + var $nodeCell = $(placeholder).siblings().filter('[data-history-node-id]'); + var nodeID = $nodeCell.data('history-node-id'); var lastViewTimestamp = Drupal.history.getLastRead(nodeID); // Queue this placeholder's "X new" replies link to be downloaded from the @@ -105,7 +107,7 @@ $.ajax({ url: Drupal.url('comments/render_new_comments_node_links'), type: 'POST', - data: {'node_ids[]': nodeIDs}, + data: {'node_ids[]': nodeIDs, 'field_name': 'comment'}, dataType: 'json', success: function (results) { for (var nodeID in results) {