argument, to be used when there is no HTML definition of the template
(either in this team or in the global area), and the team has not
registered a template of this name. The fallback string is used ahead
of the global default.
};
- function loadTemplate(name) {
+ function loadTemplate(name, fallbackString) {
var template = m_template[name];
if (template === undefined) {
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);
}