diff options
Diffstat (limited to 'data/lib')
-rw-r--r-- | data/lib/bugzillaDOMFunctions.js | 4 | ||||
-rw-r--r-- | data/lib/util.js | 54 |
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 +} |