Merged from 1.7.
This commit is contained in:
@@ -367,17 +367,15 @@ section_class.prototype.remove_resource = function(el) {
|
||||
}
|
||||
}
|
||||
}
|
||||
//remove "text" nodes to keep DOM clean
|
||||
var childIndex = null;
|
||||
var childrenCount = this.resources_ul.childNodes.length;
|
||||
for (var i=0; i<childrenCount; i++) {
|
||||
if (this.resources_ul.childNodes[i] == el.getEl()) {
|
||||
childIndex = i;
|
||||
}
|
||||
}
|
||||
if (childIndex > 0 && childIndex < this.resources_ul.childNodes.length) {
|
||||
this.resources_ul.removeChild(this.resources_ul.childNodes[childIndex - 1]);
|
||||
// Remove any extra text nodes to keep DOM clean.
|
||||
var kids = el.getEl().parentNode.childNodes;
|
||||
var i = kids.length;
|
||||
while (i--) {
|
||||
if (kids[i].nodeType == 3) {
|
||||
kids[i].parentNode.removeChild(kids[i]);
|
||||
}
|
||||
}
|
||||
|
||||
YAHOO.log("Removing "+el.getEl().id);
|
||||
if (el.getEl().parentNode != null) {
|
||||
el.getEl().parentNode.removeChild(el.getEl());
|
||||
|
||||
Reference in New Issue
Block a user