[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.
--- 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');
+ );
}
}