diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-04-07 20:08:35 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-04-07 20:08:35 +0200 |
commit | 76125263d227d333c30c6a7e6e6ebd4cfe6abc79 (patch) | |
tree | 7844eb94e5300f3ae5ea1df1b571ef620f6690e2 /data/lib | |
parent | 9329241b641ff988352d6ba233a888aef1a46f10 (diff) | |
download | bugzilla-triage-76125263d227d333c30c6a7e6e6ebd4cfe6abc79.tar.gz |
Make a new bug link for the current component independent of BZ instance.
Diffstat (limited to 'data/lib')
-rw-r--r-- | data/lib/addNewLinks.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/data/lib/addNewLinks.js b/data/lib/addNewLinks.js index 735a0fc..02bd658 100644 --- a/data/lib/addNewLinks.js +++ b/data/lib/addNewLinks.js @@ -36,9 +36,6 @@ * ***** END LICENSE BLOCK ***** */ function addNewLinks(d) { - // Why we are using d.querySelector for something which could be - // getElementById().value? FIXME - // console.log("addNewLinks : product = " + document.getElementById("product").value); var product = d.querySelector("#field_container_product option[selected]"); var component = d.querySelector("#component option[selected]"); @@ -58,11 +55,15 @@ function addNewLinks(d) { '&component=' + encodeURIComponent(component.value); if (label) { var componentElement = document.getElementById("bz_component_input"); - var computedStyle = window.getComputedStyle(componentElement); - console.log("computedStyle.display = " + computedStyle.display); - if (computedStyle.display == "none") { - label = document.getElementById("bz_component_edit_container"); - }; + if (componentElement) { // We are in the Red Hat bugzilla + // do we have components list visible? + if (document.getElementById('bz_component_input'). + classList.contains("bz_default_hidden")) { + label = document.getElementById("bz_component_edit_container"); + } + } else { + label = document.getElementById('component').parentNode; + } createDeadLink("file_new_bug_component", "new", label, url, [], "parens"); } } |