mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX Fixed deletion of form elements
This commit is contained in:
parent
107d655b20
commit
cd9135bc89
@ -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;
|
||||
},
|
||||
|
@ -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 %>
|
||||
@ -26,10 +25,10 @@
|
||||
<li><a href="#" title="<% _t('ADD', 'Add') %> $Title" id="$ClassName">$Title</a></li>
|
||||
<% end_control %>
|
||||
</ul>
|
||||
<div class="FormOptions">
|
||||
<% control FormOptions %>
|
||||
$FieldHolder
|
||||
<% end_control %>
|
||||
<div class="FormOptions">
|
||||
<% control FormOptions %>
|
||||
$FieldHolder
|
||||
<% end_control %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user