projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c89b69
)
Per-facet templates.
author
Jason Skomorowski
<jason@indexdata.com>
Tue, 8 Jul 2014 00:32:13 +0000
(20:32 -0400)
committer
Jason Skomorowski
<jason@indexdata.com>
Tue, 8 Jul 2014 00:32:13 +0000
(20:32 -0400)
src/mkws-widget-termlists.js
patch
|
blob
|
history
diff --git
a/src/mkws-widget-termlists.js
b/src/mkws-widget-termlists.js
index
54c65c4
..
294f3ff
100644
(file)
--- a/
src/mkws-widget-termlists.js
+++ b/
src/mkws-widget-termlists.js
@@
-59,7
+59,19
@@
mkws.registerWidgetType('Facet', function() {
linkdata: linkdata
});
}
linkdata: linkdata
});
}
- var template = team.loadTemplate(that.config.template || "Facet");
+ // configured template > facet specific template > default facet template
+ var template;
+ if (that.config.template) {
+ template = team.loadTemplate(that.config.template);
+ } else {
+ template = team.loadTemplate("Facet-" + caption);
+ if (template) {
+ that.log("Using Facet-" + caption + " template.")
+ } else {
+ that.log("No " + caption + " specific template, using default.")
+ template = team.loadTemplate("Facet");
+ }
+ }
that.node.html(template({
name: name,
caption: caption,
that.node.html(template({
name: name,
caption: caption,