X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=f4e0c8858bd2618d3380ffd8d84998049075e9b1;hb=99d47be7e409d5e33ada783cbcaa79b7ef5b2048;hp=633052fe67f207dc7cd976d5ddf446473464212a;hpb=af92652a288e7f9b66ad46f0aaf977b828f683d8;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index 633052f..f4e0c88 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -126,6 +126,7 @@ function team($, teamName) { queue("firstrecords").publish(hitcount); } if (parseInt(data.activeclients[0], 10) === 0) { + log("complete"); queue("complete").publish(hitcount); } } @@ -248,6 +249,7 @@ function team($, teamName) { function resetPage() { m_currentPage = 1; m_totalRecordCount = 0; + m_gotRecords = false; } that.resetPage = resetPage; @@ -384,7 +386,7 @@ function team($, teamName) { }; - function loadTemplate(name) { + function loadTemplate(name, fallbackString) { var template = m_template[name]; if (template === undefined) { @@ -398,13 +400,20 @@ function team($, teamName) { source = node.html(); } + // If the template is not defined in HTML, check the following + // in order: template registered in the team by a widget; + // fallback string provided on this invocation; global default. if (!source) { source = m_templateText[name]; } if (!source) { + source = fallbackString; + } + if (!source) { source = mkws.defaultTemplate(name); } + if (!source) return null; template = Handlebars.compile(source); log("compiled template '" + name + "'"); m_template[name] = template;