web/data/cubicweb.edition.js
branchstable
changeset 2334 464c896bee65
parent 2330 8c70ca715fe9
child 2345 16e3d0e47ee6
--- a/web/data/cubicweb.edition.js	Wed Jul 08 20:30:50 2009 +0200
+++ b/web/data/cubicweb.edition.js	Wed Jul 08 20:50:54 2009 +0200
@@ -495,7 +495,7 @@
     return false;
 }
 
-function inlineValidateRelationForm(formid, rtype, role, eid, divid, vid,
+function inlineValidateRelationForm(formid, rtype, role, eid, divid, reload, vid,
                                     default_value, escape, lzone) {
     try {
 	var form = getNode(formid);
@@ -509,17 +509,21 @@
 	return false;
     }
     d.addCallback(function (result, req) {
-        handleFormValidationResponse(formid, noop, noop, result);
-	var fieldview = getNode(divid);
-        fieldview.innerHTML = result[2];
-	// switch inline form off only if no error
-	if (result[0]) {
-          // hide global error messages
-	  jQuery('div.errorMessage').remove();
-	  jQuery('#appMsg').hide();
-          var inputname = 'edit' + role[0] + '-' + relname;
-          jQuery('input[name=' + inputname + ']').val(newtarget);
-	  cancelInlineEdit(eid, rtype, divid);
+        if (reload) {
+          document.location.href = result[1];
+        } else {
+          handleFormValidationResponse(formid, noop, noop, result);
+	  var fieldview = getNode(divid);
+          fieldview.innerHTML = result[2];
+	  // switch inline form off only if no error
+	  if (result[0]) {
+            // hide global error messages
+	    jQuery('div.errorMessage').remove();
+	    jQuery('#appMsg').hide();
+            var inputname = 'edit' + role[0] + '-' + relname;
+            jQuery('input[name=' + inputname + ']').val(newtarget);
+	    cancelInlineEdit(eid, rtype, divid);
+          }
 	}
         return false;
     });