Minor update

Made sure all vars are declared with the var keyword.
	modified:   plugin/leap/leap.js
This commit is contained in:
Rory Hardy 2013-08-07 22:40:07 -05:00
parent 0a78486b22
commit b2c6ccc912
1 changed files with 4 additions and 5 deletions

View File

@ -37,8 +37,7 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
pointerSize : 15, // Default minimum height/width of the pointer. pointerSize : 15, // Default minimum height/width of the pointer.
pointerTolerance : 120 // Bigger = slower pointer. pointerTolerance : 120 // Bigger = slower pointer.
}, },
now, entered, enteredPosition, now, size, tipPosition; // Other vars we need later, but don't need to redeclare.
entered;
// Merge user defined settings with defaults // Merge user defined settings with defaults
if( leapConfig ) { if( leapConfig ) {
@ -63,7 +62,7 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
// The innaccuracies were observed on a development model and may not be an issue with consumer models. // The innaccuracies were observed on a development model and may not be an issue with consumer models.
if( frame.fingers.length > 0 && frame.fingers.length < 3 ) { if( frame.fingers.length > 0 && frame.fingers.length < 3 ) {
// Invert direction and multiply by 3 for greater effect. // Invert direction and multiply by 3 for greater effect.
var size = -3 * frame.fingers[0].tipPosition[2]; size = -3 * frame.fingers[0].tipPosition[2];
if( size < config.pointerSize ) { if( size < config.pointerSize ) {
size = config.pointerSize; size = config.pointerSize;
@ -74,9 +73,9 @@ var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)re
pointer.style.borderRadius = size - 5 + 'px'; pointer.style.borderRadius = size - 5 + 'px';
pointer.style.visibility = 'visible'; pointer.style.visibility = 'visible';
if( config.autoCenter ) {
tipPosition = frame.fingers[0].tipPosition; tipPosition = frame.fingers[0].tipPosition;
if( config.autoCenter ) {
// Check whether the finger has entered the z range of the Leap Motion. Used for the autoCenter option. // Check whether the finger has entered the z range of the Leap Motion. Used for the autoCenter option.
if( !entered ) { if( !entered ) {
entered = true; entered = true;