1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-12 08:04:14 +02:00

Parens normalisation

This commit is contained in:
Antonio Laguna
2017-04-29 22:51:03 +02:00
parent 1de7249a65
commit d1840ec016
3 changed files with 7 additions and 6 deletions

View File

@@ -110,6 +110,7 @@
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"spaced-comment": [2, "always"],
"space-in-parens": [2, "never"],
// ECMAScript 6
// http://eslint.org/docs/rules/#ecmascript-6

View File

@@ -48,10 +48,10 @@ export default class Zoom {
* @param {Event} event Key down event
*/
onKeyDown(event) {
if ( !this.isZoomed_ && Keys.MINUS.includes( event.which ) ) {
if (!this.isZoomed_ && Keys.MINUS.includes(event.which)) {
this.zoomIn();
} else if ( this.isZoomed_ &&
(Keys.PLUS.includes( event.which ) || event.which == Keys.ESCAPE ) ) {
} else if (this.isZoomed_ &&
(Keys.PLUS.includes(event.which) || event.which === Keys.ESCAPE)) {
this.zoomOut();
}
}
@@ -79,7 +79,7 @@ export default class Zoom {
DOM.after(this.zws_.el, this.ws_.el);
// Creates the container for each slide
this.zws_.slides.forEach( elem => this.createSlideBlock_(elem));
this.zws_.slides.forEach(elem => this.createSlideBlock_(elem));
}
/**
@@ -195,7 +195,7 @@ export default class Zoom {
onWindowResize(ev) {
if (this.isZoomed_) this.zoomOut();
this.zws_.slides.forEach( elem => {
this.zws_.slides.forEach(elem => {
const wrap = elem.el.parentElement;
const div = wrap.parentElement;
this.setSizes_(div, wrap, elem);

View File

@@ -188,7 +188,7 @@ export default class DOM {
* @return {integer} The property without the units
*/
static parseSize(prop) {
return Number( prop.replace( /[^\d\.]/g, '' ) );
return Number(prop.replace(/[^\d\.]/g, ''));
}
/**