Merge lp:~vthompson/music-app/fix-1428913 into lp:music-app/remix

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 846
Merged at revision: 845
Proposed branch: lp:~vthompson/music-app/fix-1428913
Merge into: lp:music-app/remix
Diff against target: 35 lines (+10/-12)
1 file modified
common/ListItemWithActions.qml (+10/-12)
To merge this branch: bzr merge lp:~vthompson/music-app/fix-1428913
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+252052@code.launchpad.net

Commit message

Trigger list reset animation when the index did not change.

Description of the change

Trigger list reset animation when the index did not change.

To post a comment you must log in.
lp:~vthompson/music-app/fix-1428913 updated
845. By Victor Thompson

remove added from property.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
lp:~vthompson/music-app/fix-1428913 updated
846. By Victor Thompson

add new line

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

LGTM :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common/ListItemWithActions.qml'
2--- common/ListItemWithActions.qml 2015-01-18 00:06:06 +0000
3+++ common/ListItemWithActions.qml 2015-03-06 02:43:07 +0000
4@@ -544,21 +544,19 @@
5
6 root.parent.parent.interactive = true; // reenable scrolling
7
8- if (diff === 0) {
9+ var newIndex = index + diff;
10+
11+ if (newIndex < 0) {
12+ newIndex = 0;
13+ } else if (newIndex > root.parent.parent.count - 1) {
14+ newIndex = root.parent.parent.count - 1;
15+ }
16+
17+ if (index === newIndex) {
18 // Nothing has changed so reset the item
19 // z index is restored after animation
20 resetListItemYAnimation.start();
21- }
22- else {
23- var newIndex = index + diff;
24-
25- if (newIndex < 0) {
26- newIndex = 0;
27- }
28- else if (newIndex > root.parent.parent.count - 1) {
29- newIndex = root.parent.parent.count - 1;
30- }
31-
32+ } else {
33 root.z -= 10; // restore z index
34 reorder(index, newIndex)
35 }

Subscribers

People subscribed via source and target branches