From: Mike Taylor Date: Tue, 9 Jul 2013 16:51:49 +0000 (+0100) Subject: Inline the mkws_responsive_design() function, which is only used once. X-Git-Tag: 0.9.1~302 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=c91938eb5b2469a466b5b6ea74959a3ebfb31fe9 Inline the mkws_responsive_design() function, which is only used once. --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 6c544ea..099e67f 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -614,8 +614,19 @@ function mkws_html_all(config) { if (mkws_config.use_service_proxy) mkws_service_proxy_auth(config.service_proxy_auth); - if (mkws_config.responsive_design) - mkws_responsive_design(); + if (mkws_config.responsive_design) { + // Responsive web design - change layout on the fly based on + // current screen width. Required for mobile devices. + var timeout = null; + $(window).resize( function(e) { + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(function () { mkws_mobile_resize() }, 50); + }); + + // initial check after page load + $(document).ready(function() { mkws_mobile_resize() }); + } domReady(); @@ -630,22 +641,6 @@ function mkws_html_all(config) { } } -/* Responsive web design - change layout on the fly depending on - * the current screen size width/height. Required for mobile devices. - */ -function mkws_responsive_design () { - var timeout = null; - - $(window).resize( function(e) { - if (timeout) - clearTimeout(timeout); - timeout = setTimeout(function () { mkws_mobile_resize() }, 50); - }); - - // initial check after page load - $(document).ready(function() { mkws_mobile_resize() }); -} - function mkws_set_lang(mkws_config) { var lang = jQuery.parseQuerystring().lang || mkws_config.lang || ""; if (!lang || !mkws_locale_lang[lang]) {