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 &&
- parent.hasClass("mkwsTermlistContainer1")) {
- log("changing from wide to narrow: " + $(window).width());
- $(".mkwsTermlistContainer1").hide();
- $(".mkwsTermlistContainer2").show();
+ if (width <= targetWidth &&
+ parent.hasClass("mkwsTermlist-Container-wide")) {
+ log("changing from wide to narrow: " + width);
+ $(".mkwsTermlist-Container-wide").hide();
+ $(".mkwsTermlist-Container-narrow").show();
for (var tname in mkws.teams) {
- $(".mkwsTermlists.mkwsTeam_" + tname).appendTo($(".mkwsTermlistContainer2.mkwsTeam_" + tname));
+ 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 &&
- parent.hasClass("mkwsTermlistContainer2")) {
- log("changing from narrow to wide: " + $(window).width());
- $(".mkwsTermlistContainer1").show();
- $(".mkwsTermlistContainer2").hide();
+ } else if (width > targetWidth &&
+ parent.hasClass("mkwsTermlist-Container-narrow")) {
+ log("changing from narrow to wide: " + width);
+ $(".mkwsTermlist-Container-wide").show();
+ $(".mkwsTermlist-Container-narrow").hide();
for (var tname in mkws.teams) {
- $(".mkwsTermlists.mkwsTeam_" + tname).appendTo($(".mkwsTermlistContainer1.mkwsTeam_" + tname));
+ 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();
}