X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=7ec9c2f3b700a0fecd77ef91687953d5b1a3789d;hb=9f066ca3996aaaa84fc41d1291edd112be939df5;hp=415ff79f9ba266af34bea4cf66598f76348f23d8;hpb=15a552487b8c79ebb12847a422d65d5e63974b87;p=mkws-moved-to-github.git
diff --git a/src/mkws-team.js b/src/mkws-team.js
index 415ff79..7ec9c2f 100644
--- a/src/mkws-team.js
+++ b/src/mkws-team.js
@@ -185,7 +185,7 @@ mkws.makeTeam = function($, teamName) {
}
m_paz = new pz2(params);
- log("ccreated main pz2 object");
+ log("created main pz2 object");
}
@@ -408,7 +408,7 @@ mkws.makeTeam = function($, teamName) {
}
function renderDetails(data, marker) {
- var template = loadTemplate("Record");
+ var template = loadTemplate("details");
var details = template(data);
return '
' + details + '
';
@@ -417,11 +417,20 @@ mkws.makeTeam = function($, teamName) {
that.registerTemplate = function(name, text) {
+ if(mkws._old2new.hasOwnProperty(name)) {
+ mkws.log("Warning: registerTemplate old widget name: " + name + " => " + mkws._old2new[name]);
+ name = mkws._old2new[name];
+ }
m_templateText[name] = text;
};
function loadTemplate(name, fallbackString) {
+ if(mkws._old2new.hasOwnProperty(name)) {
+ mkws.log("Warning loadTemplate: old widget name: " + name + " => " + mkws._old2new[name]);
+ name = mkws._old2new[name];
+ }
+
var template = m_template[name];
if (template === undefined && Handlebars.compile) {
var source;
@@ -429,12 +438,6 @@ mkws.makeTeam = function($, teamName) {
if (node && node.length < 1) {
node = $(".mkws-template-" + name);
}
- if (node && node.length < 1) {
- node = $(".mkws-template_" + name + " .mkws-team-" + that.name());
- }
- if (node && node.length < 1) {
- node = $(".mkws-template_" + name);
- }
if (node) source = node.html();
if (!source) source = m_templateText[name];
if (source) {
@@ -454,7 +457,7 @@ mkws.makeTeam = function($, teamName) {
return template;
}
else {
- mkws.log("No MKWS template for " + name);
+ log("No MKWS template for " + name);
return null;
}
}