diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-06-06 14:16:43 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-06-06 14:16:43 +0200 |
commit | bb5c0968ad8f2dd46a4a398b505a829c584f02e6 (patch) | |
tree | 67318c9b0de3147937a59e717bf46df46b54ca92 /data | |
parent | 2d67008193187991bb61de59597925f3b776df35 (diff) | |
download | bugzilla-triage-bb5c0968ad8f2dd46a4a398b505a829c584f02e6.tar.gz |
Make coloring reporter’s comments working again.
Diffstat (limited to 'data')
-rw-r--r-- | data/lib/bzpage.js | 1 | ||||
-rw-r--r-- | data/lib/collectingMetadata.js | 20 |
2 files changed, 10 insertions, 11 deletions
diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js index c292acd..6b2a2f6 100644 --- a/data/lib/bzpage.js +++ b/data/lib/bzpage.js @@ -340,7 +340,6 @@ function completeInit() { comments: new CommentList(document) }; - if (RHBZinit) { RHBZinit(things); } diff --git a/data/lib/collectingMetadata.js b/data/lib/collectingMetadata.js index 06b43ac..f1fa488 100644 --- a/data/lib/collectingMetadata.js +++ b/data/lib/collectingMetadata.js @@ -14,10 +14,10 @@ function Comment(comment) { function CommentList(doc) { - var comments = document.getElementById("comments"). + var commentElems = document.getElementById("comments"). getElementsByClassName("bz_comment"); - comments = []; - Array.forEach(comments, function(item) { + var comments = {}; + Array.forEach(commentElems, function(item) { var com = new Comment(item); if (com.element) { comments[ISODateString(com.date)] = com; @@ -32,12 +32,13 @@ function CommentList(doc) { */ CommentList.prototype.colorComments = function colorComments() { var reporter = getReporter(); - var reporterComments = this.comments.filter(function (com) { - return com.author === reporter; - }); - reporterComments.forEach(function (com) { - com.element.style.backgroundColor = ReporterColor.toString(); - }); + var com = null; + for (var idx in this.comments) { + com = this.comments[idx]; + if (com.author === reporter) { + com.element.style.backgroundColor = ReporterColor.toString(); + } + } } CommentList.prototype.getAllCommentsText = function getAllCommentsText() { @@ -45,7 +46,6 @@ CommentList.prototype.getAllCommentsText = function getAllCommentsText() { outStr += com.getElementsByTagName("pre")[0].textContent + "\n"; }).trim(); } - // ----------------------------------------------------------- /** |