From: Mike Taylor Date: Wed, 30 Apr 2014 15:41:45 +0000 (+0100) Subject: Add new temporary variable width in resizePage function. X-Git-Tag: 1.0.0~778 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=0166658eb18e836828775d1a6a5485d0e1a98392;hp=4e343e1dc8dbf8894b0063441647e08758d5f5dd;p=mkws-moved-to-github.git Add new temporary variable width in resizePage function. --- 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) {