Skip to content

Commit

Permalink
Fixed changing the order in a list tile by drag and drop.
Browse files Browse the repository at this point in the history
Changing the order in a list tile on the Compose tab would seemingly work at first, but nothing was saved.
The wrong element was taken as base (the whole html document instead of the tile).
And iterating over the children to get their uuids was done wrong, trying to take a uuid attribute from always that same wrong element.
  • Loading branch information
mauritsvanrees committed Sep 16, 2020
1 parent 72c131e commit 427ab19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Expand Up @@ -6,7 +6,8 @@ There's a frood who really knows where his towel is.
2.2.3 (unreleased)
^^^^^^^^^^^^^^^^^^

- Nothing changed yet.
- Fixed changing the order in a list tile by drag and drop.
[maurits]


2.2.2 (2019-12-27)
Expand Down
9 changes: 5 additions & 4 deletions webpack/app/js/compose.js
Expand Up @@ -148,11 +148,12 @@ export default class ComposeView {
return;
}
let onStop = function(e, ui) {
let $el = $(e.currentTarget);
let uuids = [];
$(e.currentTarget).children().each(function(index) {
if ($el.attr('data-content-uuid') !== undefined) {
uuids.push($el.attr('data-content-uuid'));
// We iterate over the children of the original $el determined at the top of onMouseOverSortable.
$el.children().each(function(index) {
let child = $($el.children()[index]);
if (child.attr('data-content-uuid') !== undefined) {
uuids.push(child.attr('data-content-uuid'));
}
});
let tile = $el.closest('.tile');
Expand Down

0 comments on commit 427ab19

Please sign in to comment.