[web/data] Fix userCallbackThenUpdateUI to completely replace old DOM elements
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 28 Jan 2015 11:51:16 +0100
changeset 10164 2094262d6553
parent 10163 4001cfe2f44d
child 10165 7f1f7f710b16
[web/data] Fix userCallbackThenUpdateUI to completely replace old DOM elements Without the 'swap' parameter, userCallbackThenUpdateUI() would replace the _children_ of the component with a new version of the componenent, thus creating nested divs/spans/buttons/etc. Closes #4881299
web/data/cubicweb.ajax.js
--- a/web/data/cubicweb.ajax.js	Fri Jan 30 15:53:32 2015 +0100
+++ b/web/data/cubicweb.ajax.js	Wed Jan 28 11:51:16 2015 +0100
@@ -538,7 +538,7 @@
     var d = userCallback(cbname);
     d.addCallback(function() {
         $('#' + nodeid).loadxhtml(AJAX_BASE_URL, ajaxFuncArgs('render', {'rql': rql},
-                                                       registry, compid));
+                                                       registry, compid), null, 'swap');
         if (msg) {
             updateMessage(msg);
         }