Impossibilité de changer de 'sujet' lorsqu'on a saisi au moins un contact sur les formulaires 'input/phone' et 'input/facebook'
This commit is contained in:
parent
9eb7c9dfaf
commit
08502b65fb
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -111,7 +111,8 @@
|
|||
|
||||
// Animation de hover
|
||||
&:hover,
|
||||
&.active{//:not(:first-child):not(:last-child)
|
||||
&.active{
|
||||
color: #fff;
|
||||
border-color: $timeline-fb;
|
||||
background: $timeline-fb;
|
||||
}
|
||||
|
|
|
@ -29,12 +29,16 @@ inputFacebookSubject.prototype.fieldsToStorage = function(){
|
|||
// {1} Si le formulaire n'est pas valide, on ne l'enregistre pas //
|
||||
if( !this.check() ) return false;
|
||||
|
||||
// {2} On récupère et met en forme les valeurs du deflater //
|
||||
var obj = {
|
||||
subject_id: this.subject_id.value
|
||||
};
|
||||
// {2} Si on a déja saisie 1+ contact, on ne l'enregistre pas //
|
||||
if( lsi.keys('f_contacts').length > 0 ){
|
||||
Notification.warning('Attention', 'Vous devez effacer le formulaire pour changer de sujet');
|
||||
return false;
|
||||
}
|
||||
|
||||
// {3} On enregistre les données dans le 'localStorage' //
|
||||
// {3} On récupère et met en forme les valeurs du deflater //
|
||||
var obj = { subject_id: this.subject_id.value };
|
||||
|
||||
// {4} On enregistre les données dans le 'localStorage' //
|
||||
lsi.set('f_subject', 0, obj);
|
||||
|
||||
console.groupEnd();
|
||||
|
|
|
@ -103,13 +103,13 @@ inputPhoneMatrice.prototype.storageToFields = function(){
|
|||
var matrice_html = ["<table class='line'>"];
|
||||
|
||||
// {1} Pour chaque ligne //
|
||||
for( var O = 0 ; O < contacts.length ; O++ ){
|
||||
var conA = contactData[O];
|
||||
for( var L = 0 ; L < contacts.length ; L++ ){
|
||||
var conA = contactData[L];
|
||||
|
||||
|
||||
matrice_html.push( '<tr>' );
|
||||
|
||||
if( O > 0 ){ // Noms sur la première ligne (abscisses)
|
||||
if( L > 0 ){ // Noms sur la première ligne (abscisses)
|
||||
matrice_html.push( '<td style="text-align: right;">' );
|
||||
matrice_html.push( !isNaN(conA.existing) ? lsi.get('p_friends', conA.existing).name : conA.username );
|
||||
matrice_html.push( '</td>' );
|
||||
|
@ -117,25 +117,25 @@ inputPhoneMatrice.prototype.storageToFields = function(){
|
|||
matrice_html.push( '<td></td>' );
|
||||
|
||||
// {2} Pour chaque case //
|
||||
for( var B = 0 ; B < contacts.length ; B++ ){ if( B < contacts.length-1 ){
|
||||
var conB = contactData[B];
|
||||
for( var C = 0 ; C < contacts.length ; C++ ){ if( C < contacts.length-1 ){
|
||||
var conC = contactData[C];
|
||||
|
||||
// {3} Première colonne -> Intitulé des ordonnées //
|
||||
if( O == 0 ){
|
||||
if( L == 0 ){
|
||||
matrice_html.push( '<td>' );
|
||||
matrice_html.push( '<span style="writing-mode: vertical-lr; text-align: right;">' );
|
||||
matrice_html.push( !isNaN(conB.existing) ? lsi.get('p_friends', conB.existing).name : conB.username );
|
||||
matrice_html.push( !isNaN(conC.existing) ? lsi.get('p_friends', conC.existing).name : conC.username );
|
||||
matrice_html.push( '</span>' );
|
||||
|
||||
// {4} Valeurs des relations (boutons) //
|
||||
}else if( B < O ){
|
||||
}else if( C < L ){
|
||||
matrice_html.push( "<td>" );
|
||||
matrice_html.push( "<input type='checkbox' name='matrice_"+conA.uid+"_"+conB.uid+"' data-name='"+conA.uid+"' value='"+conB.uid+"' id='p_matrice_"+conA.uid+"_"+conB.uid+"'" );
|
||||
matrice_html.push( "<input type='checkbox' name='matrice_"+conA.uid+"_"+conC.uid+"' data-name='"+conA.uid+"' value='"+conC.uid+"' id='p_matrice_"+conA.uid+"_"+conC.uid+"'" );
|
||||
// Si la relation existe, on active le bouton
|
||||
if( matriceData[O] != null && matriceData[O].indexOf(B) > -1 )
|
||||
if( matriceData[L] != null && matriceData[L].indexOf(C) > -1 )
|
||||
matrice_html.push( " checked" );
|
||||
matrice_html.push( " >" );
|
||||
matrice_html.push( "<label for='p_matrice_"+conA.uid+"_"+conB.uid+"'></label>" );
|
||||
matrice_html.push( "<label for='p_matrice_"+conA.uid+"_"+conC.uid+"'></label>" );
|
||||
|
||||
// {5} Cases vides (moitié supérieure droite) //
|
||||
}else
|
||||
|
|
|
@ -29,16 +29,18 @@ inputPhoneSubject.prototype.fieldsToStorage = function(){
|
|||
// {1} Si le formulaire n'est pas valide, on ne l'enregistre pas //
|
||||
if( !this.check() ) return false;
|
||||
|
||||
// {2} On récupère et met en forme les valeurs du deflater //
|
||||
var obj = {
|
||||
subject_id: this.subject_id.value
|
||||
};
|
||||
// {2} Si on a déja saisie 1+ contact, on ne l'enregistre pas //
|
||||
if( lsi.keys('p_contacts').length > 0 ){
|
||||
Notification.warning('Attention', 'Vous devez effacer le formulaire pour changer de sujet');
|
||||
return false;
|
||||
}
|
||||
|
||||
// {3} On récupère et met en forme les valeurs du deflater //
|
||||
var obj = { subject_id: this.subject_id.value };
|
||||
|
||||
// {3} On enregistre les données dans le 'localStorage' //
|
||||
// {4} On enregistre les données dans le 'localStorage' //
|
||||
lsi.set('p_subject', 0, obj);
|
||||
|
||||
|
||||
console.groupEnd();
|
||||
};
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
function inputFacebookSubject(a,b){this.subject_id=a;this.store_button=b}inputFacebookSubject.prototype={store_button:this.store_button,subject_id:this.subject_id,handler:null};inputFacebookSubject.prototype.check=function(){return 0<this.subject_id.value.length&&!isNaN(this.subject_id.value)};inputFacebookSubject.prototype.fieldsToStorage=function(){console.group("[facebook.subject] fields to storage");if(!this.check())return!1;lsi.set("f_subject",0,{subject_id:this.subject_id.value});console.groupEnd()};
|
||||
function inputFacebookSubject(a,b){this.subject_id=a;this.store_button=b}inputFacebookSubject.prototype={store_button:this.store_button,subject_id:this.subject_id,handler:null};inputFacebookSubject.prototype.check=function(){return 0<this.subject_id.value.length&&!isNaN(this.subject_id.value)};
|
||||
inputFacebookSubject.prototype.fieldsToStorage=function(){console.group("[facebook.subject] fields to storage");if(!this.check())return!1;if(0<lsi.keys("f_contacts").length)return Notification.warning("Attention","Vous devez effacer le formulaire pour changer de sujet"),!1;lsi.set("f_subject",0,{subject_id:this.subject_id.value});console.groupEnd()};
|
||||
inputFacebookSubject.prototype.storageToFields=function(){console.group("[facebook.subject] storage to fields");var a=lsi.get("f_subject",0);null==a&&(a={subject_id:""});this.subject_id.value=a.subject_id;console.groupEnd()};
|
||||
inputFacebookSubject.prototype.attach=function(a){function b(a){c.fieldsToStorage();c.handler(!0);c.storageToFields()}console.group("[facebook.subject] attaching events");lsi.createDataset("f_subject");lsi.createDataset("f_friends");this.handler=a;var c=this;this.store_button.addEventListener("click",b,!1);this.subject_id.addEventListener("blur",b,!1);this.storageToFields();console.groupEnd()};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
function inputPhoneSubject(a,b){this.subject_id=a;this.store_button=b}inputPhoneSubject.prototype={store_button:this.store_button,subject_id:this.subject_id,handler:null};inputPhoneSubject.prototype.check=function(){return 0<this.subject_id.value.length&&!isNaN(this.subject_id.value)};inputPhoneSubject.prototype.fieldsToStorage=function(){console.group("[phone.subject] fields to storage");if(!this.check())return!1;lsi.set("p_subject",0,{subject_id:this.subject_id.value});console.groupEnd()};
|
||||
function inputPhoneSubject(a,b){this.subject_id=a;this.store_button=b}inputPhoneSubject.prototype={store_button:this.store_button,subject_id:this.subject_id,handler:null};inputPhoneSubject.prototype.check=function(){return 0<this.subject_id.value.length&&!isNaN(this.subject_id.value)};
|
||||
inputPhoneSubject.prototype.fieldsToStorage=function(){console.group("[phone.subject] fields to storage");if(!this.check())return!1;if(0<lsi.keys("p_contacts").length)return Notification.warning("Attention","Vous devez effacer le formulaire pour changer de sujet"),!1;lsi.set("p_subject",0,{subject_id:this.subject_id.value});console.groupEnd()};
|
||||
inputPhoneSubject.prototype.storageToFields=function(){console.group("[phone.subject] storage to fields");var a=lsi.get("p_subject",0),a=a||{subject_id:""};this.subject_id.value=a.subject_id;console.groupEnd()};
|
||||
inputPhoneSubject.prototype.attach=function(a){console.group("[phone.subject] attaching events");lsi.createDataset("p_subject");lsi.createDataset("p_friends");this.handler=a;a=function(a){this.fieldsToStorage();this.handler(!0);this.storageToFields()}.bind(this);this.store_button.addEventListener("click",a,!1);this.storageToFields();console.groupEnd()};
|
||||
|
|
|
@ -115,8 +115,7 @@ if( $getAllR->error == ManagerError::Success )
|
|||
<h5 data-text="Renseigner au moins un des nominatifs pour chaque amis. (pseudo, prénom et/ou nom)"></h5>
|
||||
<div class='arrow-container line' id='p_nav-contact'></div>
|
||||
|
||||
<article class='contact-panel'>
|
||||
</article>
|
||||
<article class='contact-panel'></article>
|
||||
<span data-space></span>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue