From 0166658eb18e836828775d1a6a5485d0e1a98392 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 30 Apr 2014 16:41:45 +0100 Subject: [PATCH] Add new temporary variable width in resizePage function. --- src/mkws-core.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index 589c327..afeee48 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -334,10 +334,11 @@ mkws.pagerNext = function(tname) { var targetWidth = mkws.config.responsive_design_width; var parent = $(".mkwsTermlists").parent(); + var width = $(window).width(); - if ($(window).width() <= targetWidth && + if (width <= targetWidth && parent.hasClass("mkwsTermlist-Container-wide")) { - log("changing from wide to narrow: " + $(window).width()); + log("changing from wide to narrow: " + width); $(".mkwsTermlist-Container-wide").hide(); $(".mkwsTermlist-Container-narrow").show(); for (var tname in mkws.teams) { @@ -347,9 +348,9 @@ mkws.pagerNext = function(tname) { $("." + list[i] + ".mkwsTeam_" + tname).hide(); } } - } else if ($(window).width() > targetWidth && + } else if (width > targetWidth && parent.hasClass("mkwsTermlist-Container-narrow")) { - log("changing from narrow to wide: " + $(window).width()); + log("changing from narrow to wide: " + width); $(".mkwsTermlist-Container-wide").show(); $(".mkwsTermlist-Container-narrow").hide(); for (var tname in mkws.teams) { -- 1.7.10.4