Avancée dans déplacement d'étudiants (correction d'erreurs)

This commit is contained in:
xdrm-brackets 2015-10-31 18:16:54 +01:00
parent c22fe6ab92
commit e61b914431
1 changed files with 23 additions and 10 deletions

View File

@ -11,11 +11,10 @@ if( document.querySelector('#CONTAINER hgroup.active') == null )
/* Gestion du déroulement des tableaux des groupes */
function afficherCacherGroupes(e){
e.preventDefault();
// s'il s'agit de la case "Voir plus"
if( e.target.className == 'more' ){
var thead = e.target.parentNode.parentNode.parentNode.children[0];
@ -23,19 +22,24 @@ function afficherCacherGroupes(e){
}
}
if( !afficherCacherGroupesDefined )
DOM.CONTAINER.addEventListener('click', afficherCacherGroupes, false);
var afficherCacherGroupesDefined = true;
/* on définit le Drag'n'Drop */
var dnd = new DragnDrop();
/* GESTION DU DRAG N DROP */
if( document.querySelector('#CONTAINER section[name=movestudents]') != null ){ // si c'set l'admin
var dnd = new DragnDrop();
var members = document.querySelectorAll('#CONTAINER section[name=movestudents] table tr td:not(.more)');
for( var i = 0 ; i < members.length ; i++ )
@ -58,14 +62,23 @@ if( document.querySelector('#CONTAINER section[name=movestudents]') != null ){ /
annee: 2015
};
// l'ordre n'est pas alphabétique mais va à la fin
API.send(request, function(response){ // on gère la réponse de API
if( response.request == 'success' ){
pageM.setPage('groups');
selectSection( document.querySelector('#MENU span[data-link=groups]') );
var cloneEtudiant = input; // on clone l'étudiant
input.parentNode.removeChild( input );
var tableauDestination = output.parentNode.parentNode.parentNode;
tableauDestination.children[1].removeChild( tableauDestination.children[1].lastChild );
tableauDestination.children[1].appendChild( cloneEtudiant );
dnd.setDraggable( cloneEtudiant );
tableauDestination.children[1].innerHTML += '<tr><td colspan=5 class=more></td></tr>';
// selectSection( document.querySelector('#MENU span[data-link=groups]') );
}
});
});
}