Skip to content

Commit

Permalink
(chore) Add ESLint config and fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
feimosi committed Mar 11, 2017
1 parent f1b5484 commit 6d5ff72
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
"env": {
"browser": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
4
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
};
23 changes: 12 additions & 11 deletions src/baguetteBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@

function keyDownHandler(event) {
switch (event.keyCode) {
case 37: // Left arrow
showPreviousImage();
break;
case 39: // Right arrow
showNextImage();
break;
case 27: // Esc
hideOverlay();
break;
case 37: // Left arrow
showPreviousImage();
break;
case 39: // Right arrow
showNextImage();
break;
case 27: // Esc
hideOverlay();
break;
}
}

Expand Down Expand Up @@ -377,7 +377,9 @@
// Set overlay color
try {
overlay.style.backgroundColor = options.overlayBackgroundColor;
} catch (e) {}
} catch (e) {
// Silence the error and continue
}
}

function showOverlay(chosenImageIndex) {
Expand Down Expand Up @@ -705,5 +707,4 @@
showNext: showNextImage,
showPrevious: showPreviousImage
};

}));

0 comments on commit 6d5ff72

Please sign in to comment.