BUGFIX Fixed deletion of form elements

This commit is contained in:
Sean Harvey 2009-03-31 00:53:03 +00:00
parent 107d655b20
commit cd9135bc89
2 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,8 @@ FieldEditor.prototype = {
}
},
deleteOption: function( optionToRemove ) {
this.getElementsByTagName('div')[0].removeChild( optionToRemove );
var fields = document.getElementById('Fields_fields');
fields.removeChild(optionToRemove);
}
}
@ -127,7 +128,7 @@ FieldEditorField.prototype = {
},
confirmDelete: function() {
if( confirm( 'Are you sure you want to delete this field from the form?' ) )
this.parentNode.parentNode.deleteOption( this );
this.parentNode.parentNode.parentNode.deleteOption( this );
return false;
},

View File

@ -2,7 +2,6 @@
<div class="MenuHolder">
<ul class="TopMenu Menu">
<li><% _t('ADD', 'Add') %>:</li>
<% control CreatableFields %>
<li><a href="#" title="<% _t('ADD', 'Add') %> $Title" id="$ClassName">$Title</a></li>
<% end_control %>
@ -31,5 +30,5 @@
$FieldHolder
<% end_control %>
</div>
</div>
</div>
</div>