Skip to content

Commit

Permalink
Fix list reorder for new list header
Browse files Browse the repository at this point in the history
  • Loading branch information
flibbertigibbet committed Oct 10, 2019
1 parent 4c9e0fa commit cead4ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/scripts/cac/control/cac-control-tour-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CAC.Control.TourList = (function (_, $, MapTemplates) {
var $sortableList = $destinationList.sortable({
animation: 150,
direction: 'vertical',
draggable: '.tour-place-card',
draggable: options.selectors.destinationItem,
// Allow scrolling while dragging by not using native HTML5
// See: https://github.com/SortableJS/Sortable/issues/935
forceFallback: true,
Expand All @@ -95,7 +95,8 @@ CAC.Control.TourList = (function (_, $, MapTemplates) {
// Called when Sortable list of destinations gets updated
function onDestinationListReordered(e) {
var kids = e.to.children;
for (var i = 0; i < kids.length; i++) {
// First list item is the header; skip it
for (var i = 1; i < kids.length; i++) {
var k = kids[i];
var originalIndex = k.getAttribute('data-tour-place-index');
// assign property with new order
Expand Down

0 comments on commit cead4ab

Please sign in to comment.