aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/bugzillaDOMFunctions.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-05-06 23:27:12 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-05-06 23:27:12 +0200
commitce11514ac83f11d6762fd38b01d7846d617402f8 (patch)
tree524e56da5624d65e722b583558fef1270b586d95 /data/lib/bugzillaDOMFunctions.js
parentdfd28fb5fd37e2cc07d6d1642d7e72cc0f0ab05c (diff)
downloadbugzilla-triage-ce11514ac83f11d6762fd38b01d7846d617402f8.tar.gz
Make the script working with bugzilla.gnome.org
* Fix Config_gnome.json for new system of killNodes * Make the script more tolerable to non-RH configuration Fixes #75
Diffstat (limited to 'data/lib/bugzillaDOMFunctions.js')
-rw-r--r--data/lib/bugzillaDOMFunctions.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/data/lib/bugzillaDOMFunctions.js b/data/lib/bugzillaDOMFunctions.js
index 0f7e1e0..7d9bca5 100644
--- a/data/lib/bugzillaDOMFunctions.js
+++ b/data/lib/bugzillaDOMFunctions.js
@@ -348,26 +348,28 @@ function getCCList () {
function killNodes(doc, target, remove) {
var victimElements = [];
- target.forEach(function(x) {
- var targetNode = doc.querySelector(x);
- if (targetNode) {
- if (remove) {
- victimElements.push([x,targetNode]);
+ if (target.forEach) {
+ target.forEach(function(x) {
+ var targetNode = doc.querySelector(x);
+ if (targetNode) {
+ if (remove) {
+ victimElements.push([x,targetNode]);
+ }
+ else {
+ targetNode.style.display = "none";
+ }
}
- else {
- targetNode.style.display = "none";
- }
- }
- });
+ });
+ }
var elem = {};
// Don't run victimElements.forEach here as we are effectively
// removing its members.
for(var i = 0, ii = victimElements.length; i < ii; i++) {
elem = victimElements[i];
+ console.myDebug("Killing element " + elem[0]);
try {
elem[1].parentNode.removeChild(elem[1]);
-// elem[1].style.backgroundColor = "red";
}
catch (e if e instanceof TypeError) {
console.error("Cannot remove: " + elem[0]);