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:
@@ -128,12 +128,12 @@ export default class Zoom {
|
|||||||
const scale = divCSS.width.includes('%') ?
|
const scale = divCSS.width.includes('%') ?
|
||||||
100 / DOM.parseSize(divCSS.width) :
|
100 / DOM.parseSize(divCSS.width) :
|
||||||
window.innerWidth / 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
|
// If the scale is 100% means it is mobile
|
||||||
const wsW = this.ws_.el.clientWidth;
|
const wsW = this.ws_.el.clientWidth;
|
||||||
elem.el.style.width = `${(wsW - marginW) * 2}px`;
|
elem.el.style.width = `${(wsW - marginW) * 2}px`;
|
||||||
elem.el.style.height = `${(wsW - marginH) * 1.5}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
|
// Because of flexbox, wrap height is required
|
||||||
wrap.style.height = `${(wsW - marginH) * 1.5 / 2}px`;
|
wrap.style.height = `${(wsW - marginH) * 1.5 / 2}px`;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -213,7 +213,7 @@ export default class DOM {
|
|||||||
static after(elem, target) {
|
static after(elem, target) {
|
||||||
const parent = target.parentNode;
|
const parent = target.parentNode;
|
||||||
|
|
||||||
if (parent.lastChild == target) {
|
if (parent.lastChild === target) {
|
||||||
parent.appendChild(elem);
|
parent.appendChild(elem);
|
||||||
} else {
|
} else {
|
||||||
parent.insertBefore(elem, target.nextSibling);
|
parent.insertBefore(elem, target.nextSibling);
|
||||||
|
Reference in New Issue
Block a user