mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX: refresh sortable lists after adding elements
This commit is contained in:
parent
a63089b817
commit
7491e5c9e9
@ -64,6 +64,9 @@
|
||||
statusMessage(ss.i18n._t('UserForms.ERRORCREATINGFIELD', 'Error Creating Field'));
|
||||
}
|
||||
});
|
||||
|
||||
$("#Fields_fields").sortable("refresh");
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -86,7 +89,6 @@
|
||||
* currently have it open
|
||||
*/
|
||||
$(".EditableFormField .moreOptions").live('click',function() {
|
||||
|
||||
var parentID = $(this).parents(".EditableFormField");
|
||||
if(parentID) {
|
||||
var extraOptions = parentID.children(".extraOptions");
|
||||
@ -125,7 +127,9 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(this).parents(".EditableFormField").remove();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -204,8 +208,7 @@
|
||||
* Sort Options in a Field List - Such as options in a
|
||||
* dropdown field.
|
||||
*/
|
||||
$(".editableOptions").live(function() {
|
||||
$(this).sortable({
|
||||
$(".editableOptions").sortable({
|
||||
handle : '.handle',
|
||||
cursor: 'pointer',
|
||||
items: 'li',
|
||||
@ -223,7 +226,6 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Custom Rules Interface
|
||||
@ -250,8 +252,7 @@
|
||||
/**
|
||||
* Adding a custom rule to a given form
|
||||
*/
|
||||
$(".customRules .addCondition").live('click', function() {
|
||||
|
||||
$(".customRules .addCondition").click(function() {
|
||||
// Give the user some feedback
|
||||
statusMessage(ss.i18n._t('UserForms.ADDINGNEWRULE', 'Adding New Rule'));
|
||||
|
||||
@ -281,6 +282,8 @@
|
||||
// append to the list
|
||||
currentRules.append(newRule);
|
||||
|
||||
$(".editableOptions").sortable("refresh");
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user