Merged from 1.7.

This commit is contained in:
vyshane 2007-01-25 04:37:39 +00:00
parent 25c09fc90c
commit e50b0ad904

View File

@ -359,6 +359,13 @@ section_class.prototype.get_resource_index = function(el) {
section_class.prototype.remove_resource = function(el) {
var resourceEl = el.getEl();
var parentEl = resourceEl.parentNode;
if (!parentEl) {
return false;
}
var resourceCount = this.resources.length;
if (resourceCount == 1) {
@ -380,20 +387,22 @@ section_class.prototype.remove_resource = function(el) {
}
}
}
if (el.getEl().parentNode) {
// 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]);
}
}
// Remove the resource.
YAHOO.log("Removing "+el.getEl().id);
el.getEl().parentNode.removeChild(el.getEl());
}
// Remove any extra text nodes to keep DOM clean.
var kids = parentEl.childNodes;
for (var i=0; i<kids.length; i++) {
if (kids[i].nodeType == 3) {
YAHOO.log('Removed extra text node.');
parentEl.removeChild(kids[i]);
}
}
// Remove the resource.
// FIXME
// Line below is causing IE 6 and 7 to freeze.
parentEl.removeChild(resourceEl);
this.write_sequence_list();
return true;
}
@ -763,7 +772,7 @@ resource_class.prototype.delete_button = function() {
if (!confirm(main.getString('deletecheck', main.getString(this.is)+" "+this.id))) {
return false;
}
this.getEl().parentNode.removeChild(this.getEl());
//this.getEl().parentNode.removeChild(this.getEl());
this.parentObj.remove_resource(this);
main.connect('DELETE', 'class=resource&id='+this.id);
@ -827,7 +836,7 @@ resource_class.prototype.onDragOut = function(e, ids) {
}
resource_class.prototype.onDragDrop = function(e, ids) {YAHOO.log('onDragDrop');
resource_class.prototype.onDragDrop = function(e, ids) {
var target = YAHOO.util.DDM.getBestMatch(ids);
if (!target) {
YAHOO.log('onDragDrop: Target is not valid!', 'error');