mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Added JSCS linter to enforce style conventions
This commit is contained in:
@@ -35,12 +35,12 @@
|
||||
|
||||
ns.AnchorWidget.prototype.setOrigin = function (origin) {
|
||||
this.origin = origin;
|
||||
var previous = document.querySelector('.'+OPTION_CLASSNAME+'.selected');
|
||||
var previous = document.querySelector('.' + OPTION_CLASSNAME + '.selected');
|
||||
if (previous) {
|
||||
previous.classList.remove('selected');
|
||||
}
|
||||
|
||||
var selected = document.querySelector('.'+OPTION_CLASSNAME+'[data-origin="' + origin + '"]');
|
||||
var selected = document.querySelector('.' + OPTION_CLASSNAME + '[data-origin="' + origin + '"]');
|
||||
if (selected) {
|
||||
selected.classList.add('selected');
|
||||
this.refreshNeighbors_(selected);
|
||||
@@ -64,7 +64,7 @@
|
||||
};
|
||||
|
||||
ns.AnchorWidget.prototype.refreshNeighbors_ = function (selected) {
|
||||
var options = document.querySelectorAll('.'+OPTION_CLASSNAME);
|
||||
var options = document.querySelectorAll('.' + OPTION_CLASSNAME);
|
||||
for (var i = 0 ; i < options.length ; i++) {
|
||||
options[i].removeAttribute('data-neighbor');
|
||||
}
|
||||
@@ -84,4 +84,4 @@
|
||||
el.setAttribute('data-neighbor', neighborhood);
|
||||
}
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|
||||
@@ -44,4 +44,4 @@
|
||||
}
|
||||
return value;
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|
||||
@@ -53,11 +53,10 @@
|
||||
// propagate savepath to new Piskel
|
||||
piskel.savePath = pskl.app.piskelController.getSavePath();
|
||||
pskl.app.piskelController.setPiskel(piskel, true);
|
||||
|
||||
|
||||
$.publish(Events.CLOSE_SETTINGS_DRAWER);
|
||||
};
|
||||
|
||||
|
||||
ns.ResizeController.prototype.resizeLayer_ = function (layer) {
|
||||
var resizedFrames = layer.getFrames().map(this.resizeFrame_.bind(this));
|
||||
return pskl.model.Layer.fromFrames(layer.getName(), resizedFrames);
|
||||
@@ -98,13 +97,13 @@
|
||||
value = 0;
|
||||
}
|
||||
|
||||
var height = this.piskelController.getHeight(),
|
||||
width = this.piskelController.getWidth();
|
||||
var height = this.piskelController.getHeight();
|
||||
var width = this.piskelController.getWidth();
|
||||
|
||||
if (sizeInput === this.widthInput) {
|
||||
this.heightInput.value = Math.round(value * height/width);
|
||||
this.heightInput.value = Math.round(value * height / width);
|
||||
} else if (sizeInput === this.heightInput) {
|
||||
this.widthInput.value = Math.round(value * width/height);
|
||||
this.widthInput.value = Math.round(value * width / height);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -144,7 +143,7 @@
|
||||
} else if (origin.indexOf('RIGHT') != -1) {
|
||||
return x - (width - resizedWidth);
|
||||
} else {
|
||||
return x - Math.round((width - resizedWidth)/2);
|
||||
return x - Math.round((width - resizedWidth) / 2);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -155,7 +154,7 @@
|
||||
} else if (origin.indexOf('BOTTOM') != -1) {
|
||||
return y - (height - resizedHeight);
|
||||
} else {
|
||||
return y - Math.round((height - resizedHeight)/2);
|
||||
return y - Math.round((height - resizedHeight) / 2);
|
||||
}
|
||||
};
|
||||
})();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user