Reordering with unsaved inlines is faulty and counter intuitive.

In this commit I added a javascript alert that prompts the user to save their changes before reordering if unsaved inlines are detected.
Please review and let me know if this in compliance with your guidelines.
This commit is contained in:
Moritz Pfeiffer
2013-12-03 10:45:17 +01:00
parent 629bfb058d
commit 818a231a1a
5 changed files with 48 additions and 7 deletions
@@ -16,6 +16,12 @@
items : '.inline-related',
stop : function(event, ui)
{
if ($('.inline-deletelink').length > 0) {
$(ui.sender).sortable('cancel');
alert($('#localized_save_before_reorder_message').val());
return false;
}
var indexes = [];
ui.item.parent().children('.inline-related').each(function(i)
{
@@ -16,6 +16,12 @@
items : 'tr:not(.add-row)',
stop : function(event, ui)
{
if ($('.inline-deletelink').length > 0) {
$(ui.sender).sortable('cancel');
alert($('#localized_save_before_reorder_message').val());
return false;
}
var indexes = [];
ui.item.parent().children('tr').each(function(i)
{