mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00: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 ) {
|
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() {
|
confirmDelete: function() {
|
||||||
if( confirm( 'Are you sure you want to delete this field from the form?' ) )
|
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;
|
return false;
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
<div class="MenuHolder">
|
<div class="MenuHolder">
|
||||||
<ul class="TopMenu Menu">
|
<ul class="TopMenu Menu">
|
||||||
<li><% _t('ADD', 'Add') %>:</li>
|
<li><% _t('ADD', 'Add') %>:</li>
|
||||||
|
|
||||||
<% control CreatableFields %>
|
<% control CreatableFields %>
|
||||||
<li><a href="#" title="<% _t('ADD', 'Add') %> $Title" id="$ClassName">$Title</a></li>
|
<li><a href="#" title="<% _t('ADD', 'Add') %> $Title" id="$ClassName">$Title</a></li>
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
@ -26,10 +25,10 @@
|
|||||||
<li><a href="#" title="<% _t('ADD', 'Add') %> $Title" id="$ClassName">$Title</a></li>
|
<li><a href="#" title="<% _t('ADD', 'Add') %> $Title" id="$ClassName">$Title</a></li>
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="FormOptions">
|
<div class="FormOptions">
|
||||||
<% control FormOptions %>
|
<% control FormOptions %>
|
||||||
$FieldHolder
|
$FieldHolder
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
Loading…
x
Reference in New Issue
Block a user