Fix problem where slide reordering is not retained. Fixes #2405. Commit ready for merge.

- Legacy-Id: 14354
This commit is contained in:
Ryan Cross 2017-11-11 05:39:21 +00:00
parent 5ac6cf3987
commit fec655caf9

View file

@ -69,12 +69,12 @@
$(".slides tbody").sortable({
helper: rowWidthHelper,
stop: function(event,ui) {adjustDatabase("#slides")}
stop: function(event,ui) {adjustDatabase(ui.item.parent())}
}).disableSelection();
});
function adjustDatabase(tableID) {
$(tableID + " tr").each(function() {
function adjustDatabase(tbody) {
tbody.find('tr').each(function() {
count = $(this).parent().children().index($(this)) + 1;
old_order = $(this).attr("data-order");
if ( count != old_order ) {