web/views/facets.py
changeset 2234 1fbcf202882d
parent 2181 94ca417b9b07
parent 2215 b1977f5263ac
child 2293 7ded2a1416e4
--- a/web/views/facets.py	Mon Jun 29 14:12:18 2009 +0200
+++ b/web/views/facets.py	Thu Jul 02 10:35:03 2009 +0200
@@ -38,6 +38,9 @@
     order = 1
     roundcorners = True
 
+    needs_css = 'cubicweb.facets.css'
+    needs_js = ('cubicweb.ajax.js', 'cubicweb.formfilter.js')
+
     def facetargs(self):
         """this method returns the list of extra arguments that should
         be used by the facet
@@ -56,8 +59,8 @@
 
     def call(self, view=None):
         req = self.req
-        req.add_js( ('cubicweb.ajax.js', 'cubicweb.formfilter.js') )
-        req.add_css('cubicweb.facets.css')
+        req.add_js( self.needs_js )
+        req.add_css( self.needs_css)
         if self.roundcorners:
             req.html_headers.add_onload('jQuery(".facet").corner("tl br 10px");')
         rset, vid, divid, paginate = self._get_context(view)