mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-22 12:53:23 +02:00
Avoiding type coercion
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user