projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix loadTemplate to handle null return from widgetNode.
[mkws-moved-to-github.git]
/
src
/
mkws-team.js
diff --git
a/src/mkws-team.js
b/src/mkws-team.js
index
2f0d384
..
1983508
100644
(file)
--- a/
src/mkws-team.js
+++ b/
src/mkws-team.js
@@
-452,13
+452,13
@@
function team($, teamName) {
mkwsHtmlSwitch();
findnode('.mkwsSearchForm').submit(function() {
mkwsHtmlSwitch();
findnode('.mkwsSearchForm').submit(function() {
- var val = findnode('.mkwsQuery').val();
+ var val = widgetNode('Query').val();
newSearch(val);
return false;
});
// on first page, hide the termlist
newSearch(val);
return false;
});
// on first page, hide the termlist
- $(document).ready(function() { findnode(".mkwsTermlists").hide(); });
+ $(document).ready(function() { widgetNode("Termlists").hide(); });
var container = findnode(".mkwsMOTDContainer");
if (container.length) {
// Move the MOTD from the provided element down into the container
var container = findnode(".mkwsMOTDContainer");
if (container.length) {
// Move the MOTD from the provided element down into the container
@@
-641,12
+641,15
@@
function team($, teamName) {
if (template === undefined) {
// Fall back to generic template if there is no team-specific one
if (template === undefined) {
// Fall back to generic template if there is no team-specific one
- var node = findnode(".mkwsTemplate_" + name);
- if (!node.length) {
- node = findnode(".mkwsTemplate_" + name, "ALL");
+ var source;
+ var node = widgetNode("Template_" + name);
+ if (!node) {
+ node = widgetNode("Template_" + name, "ALL");
}
}
+ if (node) {
+ source = node.html();
+ }
- var source = node.html();
if (!source) {
source = defaultTemplate(name);
}
if (!source) {
source = defaultTemplate(name);
}