diff --git a/js/includes/input-phone-mini-min.js b/js/includes/input-phone-mini-min.js index a01532a..ca0b528 100644 --- a/js/includes/input-phone-mini-min.js +++ b/js/includes/input-phone-mini-min.js @@ -4,6 +4,6 @@ job:c.job.value,loc:c.loc,hash:e};c.valid=this.check(c);c.timestamp=Date.now();l inputPhoneMini.prototype.add=function(a){console.log("MINI FICHE: ADD");if(null==a||null==a.uid)return!1;a.age=null!=a.age?a.age:this.defaultData.age;a.sexe=null!=a.sexe?a.sexe:this.defaultData.sexe;a.job=null!=a.job?a.job:this.defaultData.job;a.loc=null!=a.loc?a.loc:this.defaultData.loc;var b=lsi.get("contacts",a.uid);if(!1===b)return!1;this.container.innerHTML+=miniFicheBuilder.build({firstname:b.firstname,lastname:b.lastname,username:0==b.username.length?"":"("+b.username+")",countcall:b.countcall, countsms:b.countsms,uid:a.uid,age:a.age,job:a.job});b=$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="job"]>option[value="'+a.job+'"]');null!=b&&b.setAttribute("selected","selected");for(var c=$$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]'),b=0;binput[type="radio"][data-name="loc"]');for(b=0;b span.active"),c=0;c span.active"),c=0;c'+(c+1)+""}for(var e in a)b=$('#nav-mini [data-n="'+a[e].uid+'"]'),!0===a[e].valid?b.addClass("done"):b.remClass("done");this.nav($('#nav-mini [data-n="'+this.selected+'"]'))}; inputPhoneMini.prototype.check=function(a){return!isNaN(parseInt(a.age))&&checkRadioValue(a.sexe)&&"."!=a.job&&checkRadioValue(a.loc)?!0:!1};inputPhoneMini.prototype.attach=function(a){console.log("MINI FICHE: ATTACH");lsi.createDataset("mini-fiches");this.storageToFields();this.handler=a;var b=this;this.nav_container.addEventListener("click",function(a){b.nav(a.target);b.handler(a.target)},!1)}; diff --git a/js/includes/input-phone-mini.js b/js/includes/input-phone-mini.js index 209d2ca..3ad83f8 100644 --- a/js/includes/input-phone-mini.js +++ b/js/includes/input-phone-mini.js @@ -231,10 +231,10 @@ inputPhoneMini.prototype.sync = function(){ =========================================================*/ inputPhoneMini.prototype.nav = function(element){ /* (1) On vérifie que l'élément contient un nombre et existe */ - if( typeof element == 'undefined' ) + if( element == null ) return false; - if( isNaN(element.getData('n')) || element.parentNode.id != 'nav-mini' ) + if( element.getData('n') === false || isNaN(element.getData('n')) || element.parentNode.id != 'nav-mini' ) return false; /* (2) On désactive tous les éléments actifs */