var termlist = document.getElementById("mkwsTermlists");
replaceHtml(termlist, acc.join(''));
-
- // ### I don't believe these lines should be necessary (but they are)
- if (mkws_config.responsive_design)
- mkws_mobile_resize();
}
function add_single_facet(acc, caption, data, max, cclIndex) {
perpage_menu: true, /* show/hide perpage menu */
lang_display: [], /* display languages links for given languages, [] for all */
facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */
- responsive_design_width: 980, /* a page with less pixel width considered as mobile */
+ responsive_design_width: 980, /* a page with less pixel width considered as narrow */
debug: 1, /* debug level for development: 0..2 */
dummy: "dummy"
$("#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>');
}
if (mkws_config.responsive_design) {
// Responsive web design - change layout on the fly based on
// current screen width. Required for mobile devices.
- $(window).resize( function(e) { mkws_mobile_resize() });
+ $(window).resize( function(e) { mkws_resize_page() });
// initial check after page load
- $(document).ready(function() { mkws_mobile_resize() });
+ $(document).ready(function() { mkws_resize_page() });
}
domReady();
$("#mkwsLang").html(data);
}
-function mkws_mobile_resize () {
- debug("resize width: " + $(window).height() + ", width: " + $(window).width());
+function mkws_resize_page () {
var list = ["mkwsSwitch"];
- var obj;
- // alert($(window).width());
var width = mkws_config.responsive_design_width || 980;
-
- if ($(window).width() <= width) {
+ var parentId = $("#mkwsTermlists").parent().attr('id');
+
+ if ($(window).width() <= width &&
+ parentId === "mkwsTermlistContainer1") {
+ debug("changing from wide to narrow: " + $(window).width());
+ $("#mkwsTermlists").appendTo($("#mkwsTermlistContainer2"));
+ $("#mkwsTermlistContainer1").hide();
+ $("#mkwsTermlistContainer2").show();
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: " + $(window).width());
+ $("#mkwsTermlists").appendTo($("#mkwsTermlistContainer1"));
+ $("#mkwsTermlistContainer1").show();
+ $("#mkwsTermlistContainer2").hide();
for(var i = 0; i < list.length; i++) {
$("#" + list[i]).show();
}
- $("#mkwsTermlists").show();
- $("#mkwsShiftedTermlists").html("");
}
};
#mkwsRecords,
#mkwsTargets,
#mkwsStat,
-#mkwsShiftedTermlists,
#mkwsMOTD {
font-family: Gill Sans, "Gillius ADF", Gillius, GilliusADF, Verdana, Sans-Serif;
}
#mkwsRanking a,
#mkwsPager a,
#mkwsNavi a,
-#mkwsRecords a,
-#mkwsShiftedTermlists a {
+#mkwsRecords a {
color: #005701;
text-decoration: none;
}
#mkwsLang a:hover,
#mkwsTermlists a:hover,
#mkwsPager a:hover,
-#mkwsRecords a:hover,
-#mkwsShiftedTermlists a:hover {
+#mkwsRecords a:hover {
text-decoration: underline;
}
background: #f0f8ff;
}
-#mkwsTermlists .title,
-#mkwsShiftedTermlists .title {
+#mkwsTermlists .title {
font-size: large;
font-weight: bold;
text-transform: uppercase;
}
-#mkwsTermlists,
-#mkwsShiftedTermlists div#termlist {
+#mkwsTermlists {
background: #d0e0ff;
padding: 0.7em;
font-size: small;
-webkit-border-top-right-radius: 10px;
}
-#mkwsTermlists div.facet,
-#mkwsShiftedTermlists div.facet {
+#mkwsTermlists div.facet {
background: #e0f0ff;
padding: 0.7em;
margin-top: 0.7em;
-webkit-border-top-right-radius: 10px;
}
-#mkwsTermlists div.termtitle,
-#mkwsShiftedTermlists div.termtitle {
+#mkwsTermlists div.termtitle {
font-weight: bold;
}
-#mkwsRecords div.record,
-#mkwsShiftedTermlists div.record {
+#mkwsRecords div.record {
padding: 5px;
}
-webkit-border-top-right-radius: 10px;
}
-#mkwsRecords div.details th,
-#mkwsShiftedTermlists div.details th {
+#mkwsRecords div.details th {
text-align: right;
vertical-align: top;
padding-right: 0.6em;
}
-#mkwsRecords div.details th:after,
-#mkwsShiftedTermlists div.details th:after {
+#mkwsRecords div.details th:after {
content: ":";
}