web/data/cubicweb.edition.js
branchstable
changeset 3744 767b5d0cd3cc
parent 3742 20f429eb5f46
child 3760 9d93faa0e6dc
equal deleted inserted replaced
3743:4b683fe21160 3744:767b5d0cd3cc
   463  * @param eid : the eid of the entity being edited
   463  * @param eid : the eid of the entity being edited
   464  * @param reload: boolean to reload page if true (when changing URL dependant data)
   464  * @param reload: boolean to reload page if true (when changing URL dependant data)
   465  * @param default_value : value if the field is empty
   465  * @param default_value : value if the field is empty
   466  * @param lzone : html fragment (string) for a clic-zone triggering actual edition
   466  * @param lzone : html fragment (string) for a clic-zone triggering actual edition
   467  */
   467  */
   468 
       
   469 function inlineValidateRelationForm(rtype, role, eid, divid, reload, vid,
   468 function inlineValidateRelationForm(rtype, role, eid, divid, reload, vid,
   470                                     default_value, lzone) {
   469                                     default_value, lzone) {
   471     try {
   470     try {
   472 	var form = getNode(divid+'-form');
   471 	var form = getNode(divid+'-form');
   473         var relname = rtype + ':' + eid;
   472         var relname = rtype + ':' + eid;
   482           if (reload) {
   481           if (reload) {
   483             document.location.reload();
   482             document.location.reload();
   484           } else {
   483           } else {
   485               var args = {fname: 'reledit_form', rtype: rtype, role: role, eid: eid, divid: divid,
   484               var args = {fname: 'reledit_form', rtype: rtype, role: role, eid: eid, divid: divid,
   486                           reload: reload, vid: vid, default_value: default_value, landing_zone: lzone};
   485                           reload: reload, vid: vid, default_value: default_value, landing_zone: lzone};
   487             log('DONE');
       
   488               jQuery('#'+divid+'-reledit').parent().loadxhtml(JSON_BASE_URL, args, 'post');
   486               jQuery('#'+divid+'-reledit').parent().loadxhtml(JSON_BASE_URL, args, 'post');
   489           }
   487           }
   490 	}
   488 	}
   491         return false;
   489         return false;
   492     });
   490     });
   493   return false;
   491   return false;
   494 }
   492 }
   495 
   493 
   496 
   494 
   497 /**** inline edition ****/
   495 /**** inline edition ****/
       
   496 function loadInlineEditionForm(eid, rtype, role, eid, divid, reload, vid,
       
   497                                default_value, lzone) {
       
   498   var args = {fname: 'reledit_form', rtype: rtype, role: role, eid: eid, divid: divid,
       
   499               reload: reload, vid: vid, default_value: default_value, landing_zone: lzone,
       
   500               callback: function () {showInlineEditionForm(eid, rtype, divid);}};
       
   501   jQuery('#'+divid+'-reledit').parent().loadxhtml(JSON_BASE_URL, args, 'post');
       
   502 }
       
   503 
   498 function showInlineEditionForm(eid, rtype, divid) {
   504 function showInlineEditionForm(eid, rtype, divid) {
   499     jQuery('#' + divid).hide();
   505     jQuery('#' + divid).hide();
   500     jQuery('#' + divid+'-form').show();
   506     jQuery('#' + divid+'-form').show();
   501 }
   507 }
   502 
   508