X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fjquery%2Fjquery.crmeditable.js;h=cd7c9f02ac9143edfc5ee7229745a378833e95c6;hb=55188b9f7b1c372a9951f76c145d435c834644c9;hp=a963a36eabc4238ef10a1b6f1a205827dab7be47;hpb=68d36190d340137a13c51ce84613fa6e6cff9c11;p=civicrm-core.git diff --git a/js/jquery/jquery.crmeditable.js b/js/jquery/jquery.crmeditable.js index a963a36eab..cd7c9f02ac 100644 --- a/js/jquery/jquery.crmeditable.js +++ b/js/jquery/jquery.crmeditable.js @@ -27,7 +27,7 @@ * * * This offers two features: -* - crmEditable() edit in place of a single field +* - crmEditable() edit in place of a single field * (mostly a wrapper that binds jeditable features with the ajax api and replies on crm-entity crmf-{field} html conventions) * if you want to add an edit in place on a template: * - add a class crm-entity and id {EntityName}-{Entityid} higher in the dom @@ -72,8 +72,8 @@ // param in : a dom object that contains the field name as a class crmf-xxx var getFieldName = function (field) { if ($(field).data('field')) { - return $(field).data('field'); - } + return $(field).data('field'); + } var fieldName=field.className.match(/crmf-(\S*)/)[1]; if (!fieldName) { console && console.log && console.log("Couldn't get the crm-editable field name to modify. You need to set crmf-{field_name} or data-{field_name}"); @@ -90,7 +90,7 @@ if (!getEntityID (this,function (e,id) { entity=e; params.id = id; - + })) { return }; params['field']=getFieldName(this); @@ -156,17 +156,17 @@ var id= $i.closest('.crm-entity').attr('id'); if (id) { var e=id.match(/(\S*)-(\S*)/); - if (!e) + if (!e) console && console.log && console.log("Couldn't get the entity id. You need to set class='crm-entity' id='{entityName}-{id}'"); formSettings.entity=e[1]; formSettings.id=e[2]; - } + } if ($i.hasClass('crm-dialog')) { $i.click (function () { var $n=$('
Loading
').appendTo('body'); $n.dialog ({modal:true,width:500}); $n.crmForm (formSettings); - return false; + return false; }); } else { $i.click (function () { @@ -178,7 +178,7 @@ return false; }; $n.crmForm (formSettings); - return false; + return false; }); } return; @@ -297,7 +297,7 @@ $this.html("
Saving...
"); return true; }, - success:function(response) { + success:function(response) { if (response.indexOf('crm-error') >= 0) { // we got an error, re-display the page $this.html(response); formLoaded(target); @@ -308,7 +308,7 @@ settings.success(response); } } - }).append(''+destination).trigger('load'); + }).append(''+destination).trigger('load'); settings.load(target); };