mkws_html_lang();
debug("HTML search form");
- // ### There is only one match here by design: fix not to bother looping
- $('.mkwsSearch.mkwsTeam_' + m_teamName).each(function (i, obj) {
- var node = this;
- mkws.handle_node_with_team(this, function(tname) {
- $(node).html('\
+ var node = $('.mkwsSearch.mkwsTeam_' + m_teamName);
+ mkws.handle_node_with_team(node, function(tname) {
+ node.html('\
<form name="mkwsSearchForm" class="mkwsSearchForm mkwsTeam_' + tname + '" action="" >\
<input class="mkwsQuery mkwsTeam_' + tname + '" type="text" size="' + mkws_config.query_width + '" />\
<input class="mkwsButton mkwsTeam_' + tname + '" type="submit" value="' + M('Search') + '" />\
</form>');
- });
});
debug("HTML records");
mkws.handle_node_with_team = function(node, callback) {
- var classes = node.className;
+ // First branch for DOM objects; second branch for jQuery objects
+ var classes = node.className || node.attr('class');
+ if (!classes) {
+ // For some reason, if we try to proceed when classes is
+ // undefined, we don't get an error message, but this
+ // function and its callers, up several stack level,
+ // silently return. What a crock.
+ mkws.debug("handle_node_with_team() called on node with no classes");
+ return;
+ }
var list = classes.split(/\s+/)
var teamName, type;