aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2012-06-16 10:11:45 +0200
committerMatěj Cepl <mcepl@redhat.com>2012-06-16 10:48:38 +0200
commit3dc70b30f31321f2f9c11ce814abd8a170ec2a42 (patch)
treec393f87f8408e3d6883c07cb71348be97e89d338 /data/lib
parent03a01c78c630251416a6e21ad797158d9d16081b (diff)
downloadbugzilla-triage-3dc70b30f31321f2f9c11ce814abd8a170ec2a42.tar.gz
Don't make unavailable target for killNodes into Error.1.6.3
Also fix .json files not remove now missing target.
Diffstat (limited to 'data/lib')
-rw-r--r--data/lib/bugzillaDOMFunctions.js4
-rw-r--r--data/lib/util.js54
2 files changed, 30 insertions, 28 deletions
diff --git a/data/lib/bugzillaDOMFunctions.js b/data/lib/bugzillaDOMFunctions.js
index ae4b01d..3fa1464 100644
--- a/data/lib/bugzillaDOMFunctions.js
+++ b/data/lib/bugzillaDOMFunctions.js
@@ -426,6 +426,7 @@ function getCCList () {
*/
function killNodes(doc, target, remove) {
var victimElements = [];
+ myDebug("target:\n" + target.toSource());
if (target.forEach) {
target.forEach(function(x) {
@@ -450,7 +451,8 @@ function killNodes(doc, target, remove) {
elem[1].parentNode.removeChild(elem[1]);
}
catch (e if e instanceof TypeError) {
- console.error("Cannot remove: " + elem[0]);
+ myDebug("victimElements:\n" + victimElements.toSource());
+ console.log("Cannot remove: " + elem[0]);
};
};
}
diff --git a/data/lib/util.js b/data/lib/util.js
index 5b2372e..8db19f5 100644
--- a/data/lib/util.js
+++ b/data/lib/util.js
@@ -336,32 +336,32 @@ function filterByRegexp(list, chosingMark) {
}
}
-/**
- * remove elements from the page based on their IDs
- *
- * @param doc
- * Document object
- * @param target
- * String/Array with ID(s)
- * @param remove
- * Boolean indicating whether the node should be actually removed or
- * just hidden.
- * @return none TODO remove parameter could be replaced by function which would
- * do actual activity.
- */
-function killNodes(doc, target, remove) {
- target = target.trim();
- var targetArr = target instanceof Array ? target : target.split(/[,\s]+/);
- targetArr.forEach(function(x) {
- if (remove) {
- var targetNode = doc.getElementById(x);
- targetNode.parentNode.removeChild(targetNode);
- }
- else {
- x.style.display = "none";
- }
- });
-}
+// /**
+// * remove elements from the page based on their IDs
+// *
+// * @param doc
+// * Document object
+// * @param target
+// * String/Array with ID(s)
+// * @param remove
+// * Boolean indicating whether the node should be actually removed or
+// * just hidden.
+// * @return none TODO remove parameter could be replaced by function which would
+// * do actual activity.
+// */
+// function killNodes(doc, target, remove) {
+// target = target.trim();
+// var targetArr = target instanceof Array ? target : target.split(/[,\s]+/);
+// targetArr.forEach(function(x) {
+// if (remove) {
+// var targetNode = doc.getElementById(x);
+// targetNode.parentNode.removeChild(targetNode);
+// }
+// else {
+// x.style.display = "none";
+// }
+// });
+// }
/**
* Remove duplicate elements from array
@@ -406,4 +406,4 @@ function myDebug(str) {
console.log(str);
}
}
-} \ No newline at end of file
+}