From 383378d6a66b3b00bb540e2c1738d18d470b557e Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 30 Apr 2014 16:49:36 +0100 Subject: [PATCH] Add logging of size state-changes. --- src/mkws-core.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index afeee48..8d19f3a 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -332,10 +332,23 @@ mkws.pagerNext = function(tname) { function resizePage() { var list = ["mkwsSwitch", "mkwsLang"]; - var targetWidth = mkws.config.responsive_design_width; var parent = $(".mkwsTermlists").parent(); + var targetWidth = mkws.config.responsive_design_width; var width = $(window).width(); + if (mkws.width === undefined) { + // No state change, since we have no previous state + } else if (mkws.width <= targetWidth && width > targetWidth) { + log("narrow -> wide"); + } else if (mkws.width > targetWidth && width <= targetWidth) { + log("wide -> narrow"); + } else if (width > targetWidth) { + log("already wide"); + } else { + log("already narrow"); + } + mkws.width = width; + if (width <= targetWidth && parent.hasClass("mkwsTermlist-Container-wide")) { log("changing from wide to narrow: " + width); -- 1.7.10.4