var M = mkws.M;
- if (type === 'Targets') {
- promoteTargets();
- } else if (type === 'Stat') {
- promoteStat();
- } else if (type === 'Termlists') {
- promoteTermlists();
- } else if (type === 'Pager') {
- promotePager();
- } else if (type === 'Records') {
- promoteRecords();
+ var type2fn = {
+ Targets: promoteTargets,
+ Stat: promoteStat,
+ Termlists: promoteTermlists,
+ Pager: promotePager,
+ Records: promoteRecords
+ };
+
+ var promote = type2fn[type];
+ if (promote) {
+ promote();
+ team.debug("made " + type + " widget(node=" + node + ")");
} else {
- // ### Handle other types here
+ team.debug("made UNENCAPSULATED widget(type=" + type + ", node=" + node + ")");
}
- mkws.debug("made widget(team=" + team.name() + ", type=" + type + ", node=" + node);
return that;
// from the team object into this widget.
if (hit.recid == team.currentRecordId()) {
if (team.currentRecordData())
- html.push(renderDetails(team.currentRecordData()));
+ html.push(team.renderDetails(team.currentRecordData()));
}
}
$(node).html(html.join(''));
mkws.debug(m_teamName + ": " + timestamp + s);
}
+ that.debug = debug;
debug("start running MKWS");
var details = template(data);
return '<div class="details" id="mkwsDet_' + m_teamName + '_' + data.recid + '">' + details + '</div>';
}
+ that.renderDetails = renderDetails;
function loadTemplate(name)