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

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 843
Merged at revision: 843
Proposed branch: lp:~vthompson/music-app/refactor-fix-1428913
Merge into: lp:music-app
Diff against target: 35 lines (+10/-12)
1 file modified
app/components/ListItemReorderComponent.qml (+10/-12)
To merge this branch: bzr merge lp:~vthompson/music-app/refactor-fix-1428913
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+252054@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.

Note: this was manually merged/reimplemented because the logic for reordering was relocated from where it was in trunk.

To post a comment you must log in.
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
=== modified file 'app/components/ListItemReorderComponent.qml'
--- app/components/ListItemReorderComponent.qml 2015-02-22 02:24:16 +0000
+++ app/components/ListItemReorderComponent.qml 2015-03-06 02:40:38 +0000
@@ -64,21 +64,19 @@
6464
65 root.parent.parent.interactive = true; // reenable scrolling65 root.parent.parent.interactive = true; // reenable scrolling
6666
67 if (diff === 0) {67 var newIndex = index + diff;
68
69 if (newIndex < 0) {
70 newIndex = 0;
71 } else if (newIndex > root.parent.parent.count - 1) {
72 newIndex = root.parent.parent.count - 1;
73 }
74
75 if (index === newIndex) {
68 // Nothing has changed so reset the item76 // Nothing has changed so reset the item
69 // z index is restored after animation77 // z index is restored after animation
70 resetListItemYAnimation.start();78 resetListItemYAnimation.start();
71 }79 } else {
72 else {
73 var newIndex = index + diff;
74
75 if (newIndex < 0) {
76 newIndex = 0;
77 }
78 else if (newIndex > root.parent.parent.count - 1) {
79 newIndex = root.parent.parent.count - 1;
80 }
81
82 root.z -= 10; // restore z index80 root.z -= 10; // restore z index
83 reorder(index, newIndex)81 reorder(index, newIndex)
84 }82 }

Subscribers

People subscribed via source and target branches