Author: rhari
Date: Mon May 14 13:04:14 2007
New Revision: 430
URL: http://svn.gna.org/viewcvs/phplinker?rev=430&view=rev
Log:
#232
Bug fix
Modified:
trunk/www/js/drag-drop-folder-tree.js
Modified: trunk/www/js/drag-drop-folder-tree.js
URL:
http://svn.gna.org/viewcvs/phplinker/trunk/www/js/drag-drop-folder-tree.js?rev=430&r1=429&r2=430&view=diff
==============================================================================
--- trunk/www/js/drag-drop-folder-tree.js (original)
+++ trunk/www/js/drag-drop-folder-tree.js Mon May 14 13:04:14 2007
@@ -528,8 +528,9 @@
}
if(JSTreeObj.dragNode_source.getAttribute('is_tag') ==
'false'){
-
- if(JSTreeObj.dragNode_destination){
+// alert("categ");
+ if(JSTreeObj.dragNode_destination &&
JSTreeObj.dragNode_destination.id != 'root_tag'){
+// alert(JSTreeObj.dragNode_destination.id);
//***************************hari
2070426*********
// test si le noeud existe déjà dans la
branche cible
@@ -548,6 +549,20 @@
elt =
elt.getElementsByTagName("A")[0].childNodes[0].nodeValue.toLowerCase();
// alert(textaverifier + " = " + elt);
if (textaverifier == elt){
+ alert('Cette brance contient déjÃ
un enfant de ce nom!!!');
+ ok = 0;
+ }
+ }
+ }
+
+ if (JSTreeObj.dragNode_destination.id ==
JSTreeObj.dragNode_source.id)
+ ok = 0;
+
+
if(JSTreeObj.hasSubNodes(JSTreeObj.dragNode_source)){
+ var lis =
JSTreeObj.dragNode_source.getElementsByTagName('LI');
+ for(var no=0;no<lis.length;no++){
+// alert(lis[no].id);
+ if (JSTreeObj.dragNode_destination.id
== lis[no].id){
ok = 0;
}
}
@@ -608,7 +623,6 @@
}else{
JSTreeObj.dragNode_parent.appendChild(JSTreeObj.dragNode_source);
}
- alert('Cette brance contient déjà un
enfant de ce nom!!!');
}
}else{
// Putting the item back to it's original
location
@@ -622,6 +636,7 @@
}
//****************************hari 20070423***lastmodif
20070424*****
+ //is_tag == true
}else{
// Remise du tag à sa place initiale
@@ -632,7 +647,7 @@
JSTreeObj.dragNode_parent.appendChild(JSTreeObj.dragNode_source);
}
- if (JSTreeObj.dragNode_destination &&
JSTreeObj.dragNode_destination.id != 'root' &&
JSTreeObj.dragNode_destination.id != 'root_tag'){
+ if (JSTreeObj.dragNode_destination &&
JSTreeObj.dragNode_destination.getAttribute('is_tag') != 'true' &&
JSTreeObj.dragNode_destination.id != 'root' &&
JSTreeObj.dragNode_destination.id != 'root_tag'){
// Modification de l'id_ad_tag de la catégorie
destination
JSTreeObj.dragNode_destination.setAttribute('id_ad_tag',
JSTreeObj.dragNode_source.id.substring(4));
JSTreeObj.dragNode_destination.setAttribute('Modified', 'true');
@@ -654,7 +669,7 @@
// Si le tag est droppé dans le root, juste
modifier ces enfants
else{
- if (JSTreeObj.dragNode_destination.id !=
'root_tag' && JSTreeObj.dragNode_destination &&
JSTreeObj.hasSubNodes(JSTreeObj.dragNode_destination) && confirm("Cette action
sera récursive?"))
+ if (JSTreeObj.dragNode_destination.id !=
'root_tag' && JSTreeObj.dragNode_destination &&
JSTreeObj.dragNode_destination.getAttribute('is_tag') != 'true' &&
JSTreeObj.hasSubNodes(JSTreeObj.dragNode_destination) && confirm("Cette action
sera récursive?"))
JSTreeObj.setTag(JSTreeObj.dragNode_destination,
JSTreeObj.dragNode_source.id.substring(4));
}
}
_______________________________________________
PHPLinker-commits mailing list
[email protected]
https://mail.gna.org/listinfo/phplinker-commits