diff options
Diffstat (limited to 'data/lib/addNewLinks.js')
-rw-r--r-- | data/lib/addNewLinks.js | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/data/lib/addNewLinks.js b/data/lib/addNewLinks.js index 02bd658..b8e7bd2 100644 --- a/data/lib/addNewLinks.js +++ b/data/lib/addNewLinks.js @@ -36,35 +36,42 @@ * ***** END LICENSE BLOCK ***** */ function addNewLinks(d) { - var product = d.querySelector("#field_container_product option[selected]"); + var product = d + .querySelector("#field_container_product option[selected]"); var component = d.querySelector("#component option[selected]"); if (product) { var label = d.getElementById('field_container_product'); - var url = 'enter_bug.cgi?product=' + encodeURIComponent(product.value); + var url = 'enter_bug.cgi?product=' + + encodeURIComponent(product.value); if (label) { - createDeadLink("file_new_bug_product", "new", label, - url, [], "parens"); + createDeadLink("file_new_bug_product", "new", label, url, + [], "parens"); } } if (product && component) { var select = d.querySelector("select#component"); var label = select.parentNode; - var url = 'enter_bug.cgi?product=' + encodeURIComponent(product.value) + - '&component=' + encodeURIComponent(component.value); + var url = 'enter_bug.cgi?product=' + + encodeURIComponent(product.value) + '&component=' + + encodeURIComponent(component.value); if (label) { - var componentElement = document.getElementById("bz_component_input"); + var componentElement = document + .getElementById("bz_component_input"); 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 { + // 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"); + createDeadLink("file_new_bug_component", "new", label, + url, [], "parens"); } } } |