[views] Add missing css/js to the ConceptAutoCompleteWidget
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 22 Mar 2017 17:40:32 +0100
changeset 2529 46136e5af131
parent 2528 9e7c9100b29b
child 2530 7edee761ad4f
[views] Add missing css/js to the ConceptAutoCompleteWidget those went unnoticed because in saem they are added by some global widget, but they are actually necessary. Along the way, declare them using standard needs_css / needs_js widget class attributes. Closes #17066562
cubicweb_seda/views/widgets.py
--- a/cubicweb_seda/views/widgets.py	Wed Mar 22 17:38:49 2017 +0100
+++ b/cubicweb_seda/views/widgets.py	Wed Mar 22 17:40:32 2017 +0100
@@ -161,6 +161,10 @@
                                                              master_name='keyword_scheme',
                                                              optional=True))
     """
+    needs_css = ('jquery.ui.css',)
+    needs_js = ('jquery.ui.js',
+                'cubicweb.js', 'cubicweb.ajax.js',
+                'cubes.skoscomplete.js')
 
     def __init__(self, slave_name, master_name,
                  ajax_autocomplete_func='scheme_concepts_autocomplete',
@@ -181,7 +185,6 @@
         else:
             concept = None
         req = form._cw
-        req.add_js(('cubicweb.js', 'cubicweb.ajax.js', 'cubes.skoscomplete.js'))
         req.add_onload(js.concept_autocomplete.initConceptAutoCompleteWidget(
             master_id, slave_id, self.ajax_autocomplete_func))
         if concept is None: