[web/data] fix treeview regression (closes #3526466)
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 14 Feb 2014 14:46:25 +0100
changeset 9529 39b46b0b01e4
parent 9518 54ead5f372bb
child 9530 170e1437948d
[web/data] fix treeview regression (closes #3526466) Changeset 68cde7431c2c "[js] remove 3.9 bw compat (where apparently unused)" removed the use of form.callback from loadxhtml, which treeview relied on. Update to add a callback on the loadxhtml return value instead.
web/data/cubicweb.widgets.js
--- a/web/data/cubicweb.widgets.js	Fri Dec 20 08:39:03 2013 +0100
+++ b/web/data/cubicweb.widgets.js	Fri Feb 14 14:46:25 2014 +0100
@@ -415,17 +415,16 @@
     var url = linode.attr('cubicweb:loadurl');
     if (url) {
         linode.find('ul.placeholder').remove();
-        linode.loadxhtml(url, {
-            callback: function(domnode) {
+        var d = linode.loadxhtml(url, null, 'post', 'append');
+        d.addCallback(function(domnode) {
                 linode.removeAttr('cubicweb:loadurl');
-                jQuery(domnode).treeview({
+                linode.find('> ul.treeview').treeview({
                     toggle: toggleTree,
                     prerendered: true
                 });
                 return null;
             }
-        },
-        'post', 'append');
+        );
     }
 }