From 9094d83be3e41337f159e404718de985fee85f74 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 27 Nov 2013 11:51:45 +0000 Subject: [PATCH] Reorder functions. --- tools/htdocs/mkws.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 7d5856e..2ffffef 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -655,6 +655,23 @@ function renderDetails(data, marker) return '
' + details + '
'; } + +function maybeLoadTemplate(name) +{ + var source = $("#mkwsTemplate" + name).html(); + if (!source) { + debug("no template '" + name + "': falling back to default behaviour"); + // Mark template as not provided + mkws['template' + name] = 0; + return; + } + + var template = Handlebars.compile(source); + debug("compiled template '" + name + "'"); + mkws['template' + name] = template; +} + + function defaultRenderDetails(data, marker) { var details = ''; @@ -680,22 +697,6 @@ function defaultRenderDetails(data, marker) } -function maybeLoadTemplate(name) -{ - var source = $("#mkwsTemplate" + name).html(); - if (!source) { - debug("no template '" + name + "': falling back to default behaviour"); - // Mark template as not provided - mkws['template' + name] = 0; - return; - } - - var template = Handlebars.compile(source); - debug("compiled template '" + name + "'"); - mkws['template' + name] = template; -} - - function renderField(caption, data, data2, data3) { if (data === undefined) { return ""; -- 1.7.10.4