Fix voting when template_debug=true.

Remove leading/trailing whitespace from thing_css_class for printables.
Fixes #85.
This commit is contained in:
Logan Hanks
2011-06-20 14:39:16 -07:00
parent fd02caf035
commit 49637884b8
2 changed files with 2 additions and 4 deletions

View File

@@ -331,7 +331,7 @@ $.fn.thing_id = function(class_filter) {
t = t.find("." + class_filter + ":first");
}
if(t.length) {
var id = $.grep(t.get(0).className.split(' '),
var id = $.grep(t.get(0).className.match(/\S+/g),
function(i) { return i.match(/^id-/); });
return (id.length) ? id[0].slice(3, id[0].length) : "";
}

View File

@@ -45,9 +45,7 @@ ${self.RenderPrintable()}
%endif
</%def>
<%def name="thing_css_class(what)">
thing id-${what._fullname}
</%def>
<%def name="thing_css_class(what)">thing id-${what._fullname}</%def>
<%def name="RenderPrintable()">
<% cls = thing.lookups[0].__class__.__name__.lower() %>