$("#mkwsResults").html('\
<table width="100%" border="0" cellpadding="6" cellspacing="0">\
<tr>\
- <td width="250" valign="top">\
+ <td id="mkwsTermlistContainer1" width="250" valign="top">\
<div id="mkwsTermlists"></div>\
</td>\
<td id="mkwsMOTDContainer" valign="top">\
<div id="mkwsRecords"></div>\
</td>\
</tr>\
+ <tr>\
+ <td colspan="2">\
+ <div id="mkwsTermlistContainer2"></div>\
+ </td>\
+ </tr>\
</table>');
}
}
function mkws_mobile_resize () {
- debug("resize width: " + $(window).height() + ", width: " + $(window).width());
+ debug("resize height: " + $(window).height() + ", width: " + $(window).width());
var list = ["mkwsSwitch"];
var obj;
// alert($(window).width());
var width = mkws_config.responsive_design_width || 980;
+ var parentId = $("#mkwsTermlists").parent().attr('id');
- if ($(window).width() <= width) {
+ if ($(window).width() <= width &&
+ parentId === "mkwsTermlistContainer1") {
+ debug("changing from wide to narrow");
+ $("#mkwsTermlists").appendTo($("#mkwsTermlistContainer2"));
for(var i = 0; i < list.length; i++) {
$("#" + list[i]).hide();
}
-
- $("#mkwsTermlists").hide();
- obj = $("#mkwsTermlists").html();
- $("#mkwsShiftedTermlists").html(obj);
- } else {
+ } else if ($(window).width() > width &&
+ parentId === "mkwsTermlistContainer2") {
+ debug("changing from narrow to wide");
+ $("#mkwsTermlists").appendTo($("#mkwsTermlistContainer1"));
for(var i = 0; i < list.length; i++) {
$("#" + list[i]).show();
}
- $("#mkwsTermlists").show();
- $("#mkwsShiftedTermlists").html("");
}
};