Skip to content

Commit

Permalink
Merge pull request #35 from ncalexan/attach-button
Browse files Browse the repository at this point in the history
Fixes #34 - Attach to Bug button not shown.
  • Loading branch information
autonome committed Apr 8, 2015
2 parents 1df7723 + 198b665 commit 47cfa27
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions data/tweaks.js
Expand Up @@ -27,8 +27,7 @@ if (list) {
else {
console.log("BUG #: " + bug);
var li = makeButton(list, bug);
var a = li.querySelector('a');
a.addEventListener("click", function(event) {
li.addEventListener("click", function(event) {
let url = document.location.toString();
url = url.replace(/\/(files|commits)$/, '');
send(bug, url);
Expand Down Expand Up @@ -71,12 +70,11 @@ function linkify() {
}

function makeButton(containerNode, bug) {
// Use second node since firs one is selected.
// Use second node since the first one is selected.
var buttonNode = containerNode.children[1].cloneNode(true);
var linkNode = buttonNode.querySelector('a');
linkNode.setAttribute('href', '#attch-to-bugzilla');
linkNode.textContent = bug ? "Attach to Bug " + bug :
"Submit Bug";
buttonNode.setAttribute('href', '#attch-to-bugzilla');
buttonNode.textContent = bug ? "Attach to Bug " + bug :
"Submit Bug";
return buttonNode;
}

Expand Down

0 comments on commit 47cfa27

Please sign in to comment.