Browse Source

Fix cards not retaining their order within a category

Closes #5
main
indigane 3 years ago committed by GitHub
parent
commit
88ff113ac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      card-sort.html

5
card-sort.html

@ -364,9 +364,12 @@
}, },
}); });
categoryGrid.on('dragEnd', function handleDragEnd(data) { categoryGrid.on('dragEnd', function handleDragEnd(data) {
debouncedUpdateData();
categoriesGrid.refreshItems().layout(); categoriesGrid.refreshItems().layout();
}); });
categoryGrid.on('dragReleaseEnd', function handleDragReleaseEnd(data) {
categoryGrid.synchronize();
debouncedUpdateData();
});
cardGrids.push(categoryGrid); cardGrids.push(categoryGrid);
const cardTexts = data[name] || []; const cardTexts = data[name] || [];
for (const text of cardTexts) { for (const text of cardTexts) {

Loading…
Cancel
Save