@@ -72,16 +72,16 @@ DirectionalDragArea {
7272 onDistanceChanged: {
7373 if (status === DirectionalDragArea.Recognized) {
7474 // don't go the whole distance in order to smooth out the movement
75− var step = distance * 0.3
75+ var step = distance * 0.3;
7676
77− step = __limitMovement(step)
77+ step = __limitMovement(step);
7878
79− __totalDragDistance += step
79+ __totalDragDistance += step;
8080
8181 if (Direction.isHorizontal(direction)) {
82− parent.x += step
82+ parent.x += step;
8383 } else {
84− parent.y += step
84+ parent.y += step;
8585 }
8686 }
8787 }
@@ -90,56 +90,59 @@ DirectionalDragArea {
9090 function __limitMovement(step) {
9191 if (Direction.isPositive(direction)) {
9292 if (__totalDragDistance + step > maxTotalDragDistance) {
93− step = maxTotalDragDistance - __totalDragDistance
93+ step = maxTotalDragDistance - __totalDragDistance;
9494 } else if (__totalDragDistance + step < 0) {
95− step = 0 - __totalDragDistance
95+ step = 0 - __totalDragDistance;
9696 }
9797 } else {
9898 if (__totalDragDistance + step < -maxTotalDragDistance) {
99− step = -maxTotalDragDistance - __totalDragDistance
99+ step = -maxTotalDragDistance - __totalDragDistance;
100100 } else if (__totalDragDistance + step > 0) {
101− step = 0 - __totalDragDistance
101+ step = 0 - __totalDragDistance;
102102 }
103103 }
104104
105− return step
105+ return step;
106106 }
107107
108108 onStatusChanged: {
109109 if (status === DirectionalDragArea.WaitingForTouch) {
110110 if (__previousStatus === DirectionalDragArea.Recognized) {
111− __onFinishedRecognizedGesture()
111+ __onFinishedRecognizedGesture();
112112 }
113− __totalDragDistance = 0
113+ __totalDragDistance = 0;
114114 }
115115 else if (status === DirectionalDragArea.Undecided) {
116− dragEvaluator.reset()
116+ dragEvaluator.reset();
117117 }
118118 else if (status === DirectionalDragArea.Recognized) {
119119 if (__previousStatus === DirectionalDragArea.WaitingForTouch)
120− dragEvaluator.reset()
120+ dragEvaluator.reset();
121121 }
122− __previousStatus = status
122+ __previousStatus = status;
123123 }
124124
125125 function __onFinishedRecognizedGesture() {
126− if (dragEvaluator.shouldAutoComplete())
127− __completeDrag()
128− else
129− __rollbackDrag()
126+ if (dragEvaluator.shouldAutoComplete()) {
127+ __completeDrag();
128+ } else {
129+ __rollbackDrag();
130+ }
130131 }
131132
132133 function __completeDrag() {
133− if (parent.shown)
134− parent.hide()
135− else
136− parent.show()
134+ if (parent.shown) {
135+ parent.hide();
136+ } else {
137+ parent.show();
138+ }
137139 }
138140
139141 function __rollbackDrag() {
140− if (parent.shown)
141− parent.show()
142− else
143− parent.hide()
142+ if (parent.shown) {
143+ parent.show();
144+ } else {
145+ parent.hide();
146+ }
144147 }
145148}