[date picker widgets] use bare jquery expression rather than jqNode stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 28 Aug 2013 11:29:58 +0200
branchstable
changeset 9222 ec65ca70aac9
parent 9221 e9a3a22f98b7
child 9223 233e770293a9
[date picker widgets] use bare jquery expression rather than jqNode
web/formwidgets.py
--- a/web/formwidgets.py	Wed Jun 12 12:28:01 2013 +0200
+++ b/web/formwidgets.py	Wed Aug 28 11:29:58 2013 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -542,6 +542,7 @@
                  'removeinput': self.remove_button % jsnodes
                  })
 
+
 class BitSelect(Select):
     """Select widget for IntField using a vocabulary with bit masks as values.
 
@@ -687,7 +688,7 @@
         # XXX find a way to understand every format
         fmt = req.property_value('ui.date-format')
         fmt = fmt.replace('%Y', 'yy').replace('%m', 'mm').replace('%d', 'dd')
-        req.add_onload(u'cw.jqNode("%s").datepicker('
+        req.add_onload(u'$("#%s").datepicker('
                        '{buttonImage: "%s", dateFormat: "%s", firstDay: 1,'
                        ' showOn: "button", buttonImageOnly: true})' % (
                            domid, req.uiprops['CALENDAR_ICON'], fmt))
@@ -718,7 +719,7 @@
 
     def _render(self, form, field, renderer):
         domid = field.dom_id(form, self.suffix)
-        form._cw.add_onload(u'cw.jqNode("%s").timePicker({step: %s, separator: "%s"})' % (
+        form._cw.add_onload(u'$("#%s").timePicker({step: %s, separator: "%s"})' % (
                 domid, self.timesteps, self.separator))
         return self._render_input(form, field, domid)