Skip to content

Commit

Permalink
jsHint cleanups in gesture.js, touch.js, and Scroller.js
Browse files Browse the repository at this point in the history
Enyo-DCO-1.0-Signed-Off-By: Ben Combee (ben.combee@palm.com)
  • Loading branch information
unwiredben committed Oct 19, 2012
1 parent 7280caf commit 37aeb3c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions source/touch/Scroller.js
Expand Up @@ -52,8 +52,8 @@ enyo.kind({
strategy:
* <a href="#enyo.ScrollStrategy">ScrollStrategy</a> is the default
and implements no scrolling, relying instead on the environment
to scroll properly.
and implements no scrolling, relying instead on the environment
to scroll properly.
* <a href="#enyo.TouchScrollStrategy">TouchScrollStrategy</a>
implements a touch scrolling mechanism.
Expand Down Expand Up @@ -104,7 +104,7 @@ enyo.kind({
],
//* Returns true if platform should have touch events.
hasTouchScrolling: function() {
for (var i=0, t, m; t=this.osInfo[i]; i++) {
for (var i=0, t, m; (t=this.osInfo[i]); i++) {
if (enyo.platform[t.os]) {
return true;
}
Expand All @@ -115,7 +115,7 @@ enyo.kind({
browsers always have them).
*/
hasNativeScrolling: function() {
for (var i=0, t, m; t=this.osInfo[i]; i++) {
for (var i=0, t, m; (t=this.osInfo[i]); i++) {
if (enyo.platform[t.os] < t.version) {
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions source/touch/gesture.js
Expand Up @@ -62,14 +62,14 @@
}
},
findIdentifiedTouch: function(inTouches, inId) {
for (var i = 0, t; t = inTouches[i]; i++) {
for (var i = 0, t; (t = inTouches[i]); i++) {
if (t.identifier === inId) {
return t;
}
}
},
gesturePositions: function(inEvent) {
var first = this.findIdentifiedTouch(inEvent.touches, this.orderedTouches[0])
var first = this.findIdentifiedTouch(inEvent.touches, this.orderedTouches[0]);
var last = this.findIdentifiedTouch(inEvent.touches, this.orderedTouches[this.orderedTouches.length - 1]);
var fx = first.pageX, lx = last.pageX, fy = first.pageY, ly = last.pageY;
// center the first touch as 0,0
Expand Down Expand Up @@ -101,7 +101,7 @@
return {
magnitude: p.h,
xcenter: Math.abs(Math.round(p.fx + (p.x / 2))),
ycenter: Math.abs(Math.round(p.fy + (p.y / 2))),
ycenter: Math.abs(Math.round(p.fy + (p.y / 2)))
};
},
makeGesture: function(inType, inEvent, inCache) {
Expand All @@ -126,5 +126,5 @@
rotation: rotation
});
}
}
};
})();
2 changes: 1 addition & 1 deletion source/touch/touch.js
Expand Up @@ -85,7 +85,7 @@ enyo.requiresWindow(function() {
if (x>0 && y>0 && x<=o.width && y<=o.height) {
//console.log("IN: " + n.id + " -> [" + x + "," + y + " in " + o.width + "x" + o.height + "] (children: " + n.childNodes.length + ")");
var target;
for (var n$=n.childNodes, i=n$.length-1, c; c=n$[i]; i--) {
for (var n$=n.childNodes, i=n$.length-1, c; (c=n$[i]); i--) {
target = this.findTargetTraverse(c, inX, inY);
if (target) {
return target;
Expand Down

0 comments on commit 37aeb3c

Please sign in to comment.