1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-22 21:03:23 +02:00

Avoiding type coercion

This commit is contained in:
Antonio Laguna
2017-04-29 22:52:11 +02:00
parent f954ea2fb3
commit d2e6f562f2
2 changed files with 3 additions and 3 deletions

View File

@@ -128,12 +128,12 @@ export default class Zoom {
const scale = divCSS.width.includes('%') ?
100 / DOM.parseSize(divCSS.width) :
window.innerWidth / DOM.parseSize(divCSS.width);
if (scale == 1) {
if (scale === 1) {
// If the scale is 100% means it is mobile
const wsW = this.ws_.el.clientWidth;
elem.el.style.width = `${(wsW - marginW) * 2}px`;
elem.el.style.height = `${(wsW - marginH) * 1.5}px`;
elem.el.style.minHeight = scale == 1? 'auto' : '';
elem.el.style.minHeight = scale === 1 ? 'auto' : '';
// Because of flexbox, wrap height is required
wrap.style.height = `${(wsW - marginH) * 1.5 / 2}px`;
} else {

View File

@@ -213,7 +213,7 @@ export default class DOM {
static after(elem, target) {
const parent = target.parentNode;
if (parent.lastChild == target) {
if (parent.lastChild === target) {
parent.appendChild(elem);
} else {
parent.insertBefore(elem, target.nextSibling);