aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan@mozilla.com>2011-03-26 17:46:59 -0400
committerMatěj Cepl <mcepl@redhat.com>2011-06-05 14:42:16 +0200
commit3a4f8dc7980ddd9a18a5bf87a4374ef57647d69f (patch)
tree2746e10bb1d1879711cfa1ff6d5c9e73e0ec7648
parent23fb75565611af1e85455844be1d8931efe0a0a4 (diff)
downloadbugzilla-triage-3a4f8dc7980ddd9a18a5bf87a4374ef57647d69f.tar.gz
Do not assign an anchor to an attachment flag if it already has one.
Fix for https://bitbucket.org/ehsan/bugzilla-tweaks/issue/4/attachment-flag-link-doesnt-correctly-get
-rw-r--r--data/js/bug-page-mod.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/data/js/bug-page-mod.js b/data/js/bug-page-mod.js
index a75e776..561dda8 100644
--- a/data/js/bug-page-mod.js
+++ b/data/js/bug-page-mod.js
@@ -703,7 +703,9 @@ AttachmentFlagHandlerCtor.prototype = {
if (!(id in this._interestingFlags))
continue;
for (var j = 0; j < this._interestingFlags[id].length; ++j) {
- if (flag.equals(this._interestingFlags[id][j])) {
+ // Take care to not assign an anchor to a flag which already has one
+ if (flag.equals(this._interestingFlags[id][j]) &&
+ !("anchor" in this._interestingFlags[id][j])) {
// found an interesting flag
this._interestingFlags[id][j].anchor = this.anchorName;
anchorsCreated.push(this.anchorName);
@@ -1170,7 +1172,7 @@ function tbplbotSpamCollapser(d) {
a.href = "#";
a.addEventListener("click", function(e) {
e.preventDefault();
- var win = d.defaultView.wrappedJSObject;
+ var win = d.defaultView;
var comments = d.querySelectorAll(".bz_comment");
for (var i = 0; i < comments.length; ++i) {
var comment = comments[i];