From: Mike Taylor Date: Wed, 30 Apr 2014 15:49:36 +0000 (+0100) Subject: Add logging of size state-changes. X-Git-Tag: 1.0.0~777 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=383378d6a66b3b00bb540e2c1738d18d470b557e;p=mkws-moved-to-github.git Add logging of size state-changes. --- 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);