Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Item number not updating when reordering #39

Closed
stvnhrlnd opened this issue Apr 3, 2018 · 2 comments
Closed

Item number not updating when reordering #39

stvnhrlnd opened this issue Apr 3, 2018 · 2 comments

Comments

@stvnhrlnd
Copy link

When a name template is not supplied Inner Content uses the template Item {{$index+1}}, however this isn't reflected on the UI when the order is changed:

stacked-content-reorder

I've looked into this and I noticed that the UI.Sortable update callback is used to populate the names (see this line). If you put a breakpoint in that callback you'll see that it's called before the model is updated, so the underlying array hasn't been reordered yet. Using the stop callback instead seems to fix it, although I've not tested rigorously.

@leekelleher
Copy link
Contributor

@stvnhrlnd Thanks for raising this. I've given the stop callback a try, that appears to work well.

Did you want to submit a PR?
(I could make the code change, but would rather give you the opportunity to contribute 🥇)

@leekelleher leekelleher self-assigned this Apr 4, 2018
stvnhrlnd added a commit to stvnhrlnd/umbraco-stacked-content that referenced this issue Apr 4, 2018
Use UI.Sortable `stop` callback instead of `update` so that item numbers are properly reflected on the UI.
More info here: umco#39
@stvnhrlnd
Copy link
Author

@leekelleher PR submitted :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants