From c91938eb5b2469a466b5b6ea74959a3ebfb31fe9 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 9 Jul 2013 17:51:49 +0100 Subject: [PATCH] Inline the mkws_responsive_design() function, which is only used once. --- tools/htdocs/mkws.js | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) 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]) { -- 1.7.10.4