Merge pull request #629 from GMartigny/master

Add CodeClimate
This commit is contained in:
Julian Descottes 2017-02-02 19:30:40 +01:00 committed by GitHub
commit e74329f04e
3 changed files with 27 additions and 2 deletions

25
.codeclimate.yml Normal file
View File

@ -0,0 +1,25 @@
engines:
csslint:
enabled: true
duplication:
enabled: true
config:
languages:
- javascript
eslint:
enabled: true
checks:
wrap-iife:
enabled: false
fixme:
enabled: true
ratings:
paths:
- "**.css"
- "**.js"
exclude_paths:
- .github/
- bin/
- misc/
- src/js/lib/
- test/

View File

@ -100,7 +100,7 @@
ns.PalettesListController.prototype.getCurrentColorIndex_ = function () { ns.PalettesListController.prototype.getCurrentColorIndex_ = function () {
var currentIndex = 0; var currentIndex = 0;
var selectedColor = document.querySelector('.' + PRIMARY_COLOR_CLASSNAME); var selectedColor = document.querySelector('.' + PRIMARY_COLOR_CLASSNAME);
if (selectedColor) { if (selectedColor) {
currentIndex = parseInt(selectedColor.dataset.colorIndex, 10); currentIndex = parseInt(selectedColor.dataset.colorIndex, 10);
} }
return currentIndex; return currentIndex;

View File

@ -87,7 +87,7 @@
if (background) { if (background) {
pskl.UserSettings.set(pskl.UserSettings.CANVAS_BACKGROUND, background); pskl.UserSettings.set(pskl.UserSettings.CANVAS_BACKGROUND, background);
var selected = this.backgroundContainer.querySelector('.selected'); var selected = this.backgroundContainer.querySelector('.selected');
if (selected) { if (selected) {
selected.classList.remove('selected'); selected.classList.remove('selected');
} }
target.classList.add('selected'); target.classList.add('selected');