From 472b4298da7a144d60754cf9714c04a25f98885f Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Sun, 27 Jan 2019 21:15:52 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Always=20listen=20to=20wi?= =?UTF-8?q?ndow=20resize=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dom.js | 1 + src/style.js | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dom.js b/src/dom.js index bb921d6..fbe8e23 100644 --- a/src/dom.js +++ b/src/dom.js @@ -225,6 +225,7 @@ $.measureTextWidth = function (text) { div.style.height = 'auto'; div.style.width = 'auto'; div.style.whiteSpace = 'nowrap'; + div.style.top = '-9999px'; div.innerText = text; document.body.appendChild(div); return div.clientWidth + 1; diff --git a/src/style.js b/src/style.js index c32efe0..3f543ce 100644 --- a/src/style.js +++ b/src/style.js @@ -33,10 +33,7 @@ export default class Style { bindResizeWindow() { this.onWindowResize = this.onWindowResize.bind(this); this.onWindowResize = throttle(this.onWindowResize, 300); - - if (this.options.layout === 'fluid') { - $.on(window, 'resize', this.onWindowResize); - } + $.on(window, 'resize', this.onWindowResize); } bindScrollHeader() {