diff options
author | Ehsan Akhgari <ehsan@mozilla.com> | 2011-03-26 17:46:59 -0400 |
---|---|---|
committer | Ehsan Akhgari <ehsan@mozilla.com> | 2011-03-26 17:46:59 -0400 |
commit | 316a5956e893fbb3d25bf3f9adf07618a9a2257c (patch) | |
tree | ea5125c5a457909bb3902176a879a2b7968b52a3 | |
parent | 0d4cd0b6cf83e697adf35c27c3d20ae137012db3 (diff) | |
download | bugzilla-triage-316a5956e893fbb3d25bf3f9adf07618a9a2257c.tar.gz |
Do not assign an anchor to an attachment flag if it already has one.tweaks-1.9
Fix for https://bitbucket.org/ehsan/bugzilla-tweaks/issue/4/attachment-flag-link-doesnt-correctly-get
-rw-r--r-- | data/js/bug-page-mod.js | 6 |
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]; |