Optimisation on ne recharge pas les contacts tout le temps (plus long)
This commit is contained in:
parent
c053ebd155
commit
61b2963c98
|
@ -76,7 +76,6 @@
|
|||
<h5 data-text="Renseigner au moins un des nominatifs pour chaque contact. (pseudo, prénom et/ou nom)"></h5>
|
||||
<article class='contact-panel'>
|
||||
</article>
|
||||
<h4 data-icon='+' class='add-contact' style='cursor: pointer;'>Ajouter un contact</h4>
|
||||
<span data-space></span>
|
||||
<span data-space></span>
|
||||
<span data-space></span>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var clearAllButton=$("#clear-all"),importCallLog=$('input#call_log-import[type="file"]'),subjectManager,contactManager,miniManager,ficheManager;
|
||||
function dynamicUpdate(a){var c=a instanceof Element,b=c&&"SPAN"==a.tagName&&"switch-left"==a.className,d=c&&"SPAN"==a.tagName&&"switch-both"==a.className,e=c&&"INPUT"==a.tagName&&"submit"==a.type,c=c&&"SPAN"==a.tagName&&("nav-mini"==a.parentNode.id||"nav-fiche"==a.parentNode.id);if(!(d||b||e||c)&&!0!==a)return!1;d?(console.log("> switch firstname <-> lastname"),b=a.parentNode,a=b.children[3],b=b.children[5],d=a.value,a.value=b.value,b.value=d):b?(console.log("> switch firstname+lastname -> username"),
|
||||
b=a.parentNode,d=b.children[1],a=b.children[3],b=b.children[5],d.value=a.value+" "+b.value,a.value="",b.value=""):(console.log("> dynamic update"),miniManager.fieldsToStorage(),ficheManager.fieldsToStorage(),contactManager.fieldsToStorage(),miniManager.sync(),ficheManager.sync(),miniManager.storageToFields(),ficheManager.storageToFields())}function checkRadioValue(a){for(var c=0,b=0;b<a.length;b++)!0===a[b].status&&c++;return 1!=c?!1:!0}
|
||||
b=a.parentNode,d=b.children[1],a=b.children[3],b=b.children[5],d.value=a.value+" "+b.value,a.value="",b.value=""):(console.log("> dynamic update"),miniManager.fieldsToStorage(),ficheManager.fieldsToStorage(),contactManager.fieldsToStorage(),miniManager.sync(),ficheManager.sync(),miniManager.storageToFields(),ficheManager.storageToFields(),e&&contactManager.storageToFields())}function checkRadioValue(a){for(var c=0,b=0;b<a.length;b++)!0===a[b].status&&c++;return 1!=c?!1:!0}
|
||||
include("/js/includes/input-phone-subject.js",function(){include("/js/includes/input-phone-contact.js",function(){include("/js/includes/input-phone-mini.js",function(){include("/js/includes/input-phone-fiche.js",function(){subjectManager=new inputPhoneSubject($('article.subject-panel [data-name="number"]'),$('article.subject-panel [data-name="username"]'),$('article.subject-panel [data-name="firstname"]'),$('article.subject-panel [data-name="lastname"]'),$('article.subject-panel [data-name="submit"]'));
|
||||
subjectManager.attach();contactManager=new inputPhoneContact($("article.contact-panel"),$("h4.add-contact"));contactManager.attach(dynamicUpdate);miniManager=new inputPhoneMini($("article.mini-relation-panel"),$("#nav-mini"));miniManager.attach(dynamicUpdate);ficheManager=new inputPhoneFiche($("article.relation-panel"),$("#nav-fiche"));ficheManager.attach(dynamicUpdate);importCallLog.addEventListener("change",function(a){api.send({path:"upload/call_log",file:importCallLog.files[0]},function(a){console.log(a);
|
||||
0==a.ModuleError&&(importCallLog.addClass("active"),a={path:"call_log/unserialize",phone_number:$("#subject_phone_number").value},api.send(a,function(a){console.log(a);if(0==a.ModuleError){for(var d=0;d<a.directory.length;d++){var c=(null===a.directory[d].name?"":a.directory[d].name).split(" ");lsi.set("contacts","form"+d,{uid:d,number:a.directory[d].number,username:1==c.length?c[0]:"",firstname:1<c.length?c[0]:"",lastname:1<c.length?c.splice(1).join(" "):""})}contactManager.storageToFields();dynamicUpdate(!0)}}))})},
|
||||
|
|
|
@ -94,7 +94,10 @@ function dynamicUpdate(target){
|
|||
/* (6) On affiche le tout */
|
||||
miniManager.storageToFields();
|
||||
ficheManager.storageToFields();
|
||||
// contactManager.storageToFields();
|
||||
|
||||
/* (7) On met à jour les contacts si on les a modifié */
|
||||
if( isSaveButton )
|
||||
contactManager.storageToFields();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,6 +113,24 @@ function checkRadioValue(selectData){
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* [2] Inclusion des scripts externes et lancement
|
||||
=========================================================*/
|
||||
|
|
Loading…
Reference in New Issue