Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Remove ALL_CAPS variables for closure compatibility
Browse files Browse the repository at this point in the history
Fixes #82 Style: Mutated Closure Constant Variables
  • Loading branch information
dfreedm committed Dec 12, 2014
1 parent 17a6304 commit de5aa39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

var WHICH_TO_BUTTONS = [0, 1, 4, 2];

var CURRENT_BUTTONS = 0;
var currentButtons = 0;

var FIREFOX_LINUX = /Linux.*Firefox\//i;

Expand Down Expand Up @@ -79,11 +79,11 @@
var type = inEvent.type;
var bit = WHICH_TO_BUTTONS[inEvent.which] || 0;
if (type === 'mousedown') {
CURRENT_BUTTONS |= bit;
currentButtons |= bit;
} else if (type === 'mouseup') {
CURRENT_BUTTONS &= ~bit;
currentButtons &= ~bit;
}
e.buttons = CURRENT_BUTTONS;
e.buttons = currentButtons;
}
return e;
},
Expand All @@ -105,7 +105,7 @@
// handle case where we missed a mouseup
if ((HAS_BUTTONS ? e.buttons : e.which) === 0) {
if (!HAS_BUTTONS) {
CURRENT_BUTTONS = e.buttons = 0;
currentButtons = e.buttons = 0;
}
dispatcher.cancel(e);
this.cleanupMouse(e.buttons);
Expand Down
10 changes: 5 additions & 5 deletions src/targetfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

(function(scope) {
var HAS_FULL_PATH = false;
var hasFullPath = false;

// test for full event path support
var pathTest = document.createElement('meta');
Expand All @@ -19,7 +19,7 @@
pathTest.addEventListener('testpath', function(ev) {
if (ev.path) {
// if the span is in the event path, then path[0] is the real source for all events
HAS_FULL_PATH = ev.path[0] === s;
hasFullPath = ev.path[0] === s;
}
ev.stopPropagation();
});
Expand Down Expand Up @@ -96,7 +96,7 @@
return s;
},
findTarget: function(inEvent) {
if (HAS_FULL_PATH && inEvent.path && inEvent.path.length) {
if (hasFullPath && inEvent.path && inEvent.path.length) {
return inEvent.path[0];
}
var x = inEvent.clientX, y = inEvent.clientY;
Expand All @@ -110,7 +110,7 @@
},
findTouchAction: function(inEvent) {
var n;
if (HAS_FULL_PATH && inEvent.path && inEvent.path.length) {
if (hasFullPath && inEvent.path && inEvent.path.length) {
var path = inEvent.path;
for (var i = 0; i < path.length; i++) {
n = path[i];
Expand Down Expand Up @@ -189,7 +189,7 @@
},
path: function(event) {
var p;
if (HAS_FULL_PATH && event.path && event.path.length) {
if (hasFullPath && event.path && event.path.length) {
p = event.path;
} else {
p = [];
Expand Down

0 comments on commit de5aa39

Please sign in to comment.