fix remove/do not remove action sequence (using a temp attribute instead of setting a wrong value in the resurrected hidden input) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 01 Oct 2009 17:15:46 +0200
branchstable
changeset 3545 242b07b6d820
parent 3544 188d86631c45
child 3549 63718638352e
fix remove/do not remove action sequence (using a temp attribute instead of setting a wrong value in the resurrected hidden input)
web/data/cubicweb.edition.js
--- a/web/data/cubicweb.edition.js	Thu Oct 01 16:06:29 2009 +0200
+++ b/web/data/cubicweb.edition.js	Thu Oct 01 17:15:46 2009 +0200
@@ -288,8 +288,9 @@
     // XXX work around the eid_param thing (eid + ':' + eid) for #471746
     var nodeid = ['rel', peid, rtype, eid + ':' + eid].join('-');
     var node = jqNode(nodeid);
-    if (node && node.length) {
-	node.remove();
+    if (! node.attr('cubicweb:type')) {
+        node.attr('cubicweb:type', node.val());
+        node.val('');
 	var divid = ['div', peid, rtype, eid].join('-');
 	jqNode(divid).fadeTo('fast', 0.5);
 	var noticeid = ['notice', peid, rtype, eid].join('-');
@@ -301,9 +302,9 @@
     // XXX work around the eid_param thing (eid + ':' + eid) for #471746
     var nodeid = ['rel', peid, rtype, eid + ':' + eid].join('-');
     var node = jqNode(nodeid);
-    if (!(node && node.length)) {
-	node = INPUT({type: 'hidden', id: nodeid,
-		      name: rtype+':'+peid, value: eid});
+    if (node.attr('cubicweb:type')) {
+        node.val(node.attr('cubicweb:type'));
+        node.attr('cubicweb:type', '');
 	jqNode(['fs', peid, rtype, eid].join('-')).append(node);
         var divid = ['div', peid, rtype, eid].join('-');
 	jqNode(divid).fadeTo('fast', 1);