web/views/tabs.py
branchstable
changeset 7819 93d9a9c29bfb
parent 7742 1273c1bc0237
child 7820 2c73fc529a20
--- a/web/views/tabs.py	Wed Sep 21 18:35:45 2011 +0200
+++ b/web/views/tabs.py	Wed Sep 21 19:00:49 2011 +0200
@@ -140,9 +140,7 @@
         for i, (tabid, domid, tabkwargs) in enumerate(tabs):
             w(u'<li>')
             w(u'<a href="#%s">' % domid)
-            w(u'<span onclick="%s">' % xml_escape(unicode(uilib.js.setTab(domid, self.cookie_name))))
             w(tabkwargs.pop('label', self._cw._(tabid)))
-            w(u'</span>')
             w(u'</a>')
             w(u'</li>')
             if domid == active_tab:
@@ -160,7 +158,12 @@
         # because the callback binding needs to be done before
         # XXX make work history: true
         self._cw.add_onload(u"""
-  jQuery('#entity-tabs-%(eeid)s').tabs( { selected: %(tabindex)s });
+  jQuery('#entity-tabs-%(eeid)s').tabs(
+    { selected: %(tabindex)s,
+      select: function(event, ui) {
+        setTab(ui.panel.id, '%(cookiename)s');
+      }
+    });
   setTab('%(domid)s', '%(cookiename)s');
 """ % {'tabindex'   : active_tab_idx,
        'domid'        : active_tab,