function resizePage() {
var list = ["mkwsSwitch", "mkwsLang"];
- var width = mkws.config.responsive_design_width;
+ var targetWidth = mkws.config.responsive_design_width;
var parent = $(".mkwsTermlists").parent();
+ var width = $(window).width();
- if ($(window).width() <= width &&
+ 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) {
+ mkws.teams[tname].queue("resize-narrow").publish();
$(".mkwsTermlists.mkwsTeam_" + tname).appendTo($(".mkwsTermlist-Container-narrow.mkwsTeam_" + tname));
for(var i = 0; i < list.length; i++) {
$("." + list[i] + ".mkwsTeam_" + tname).hide();
}
}
- } else if ($(window).width() > width &&
+ } 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) {
+ mkws.teams[tname].queue("resize-wide").publish();
$(".mkwsTermlists.mkwsTeam_" + tname).appendTo($(".mkwsTermlist-Container-wide.mkwsTeam_" + tname));
for(var i = 0; i < list.length; i++) {
$("." + list[i] + ".mkwsTeam_" + tname).show();