Sfoglia il codice sorgente

Add files via upload

Daniele Bonini (皮夕): WebDev and DevOps by lots of Sim.pli.city bits 3 anni fa
parent
commit
932f47ec24
1 ha cambiato i file con 11 aggiunte e 8 eliminazioni
  1. 11 8
      Public/js/dragndrop-code.js

+ 11 - 8
Public/js/dragndrop-code.js

@@ -83,16 +83,19 @@ function onDrop(tthis, e) {
 
   //alert(newcube.cats);
   //alert(newcube.cats.indexOf(curcat));
-  bcatfound = false;
-  mycats = " " + newcube.cats + " ";
-  if ((mycats.indexOf(curcat) === -1)) {
-    newcube.cats += " " + curcat;      
-    newcube.xml = updCubeXML(newcube.xml, "cats", newcube.cats);
+  if (curcat!=="*") {
+    bcatfound = false;
+    mycats = " " + newcube.cats + " ";
+    if ((mycats.indexOf(curcat) === -1)) {
+      newcube.cats += " " + curcat;      
+      newcube.xml = updCubeXML(newcube.xml, "cats", newcube.cats);
+    } else {
+      bcatfound = curcat;
+    }  
+    //alert(newcube.cats);
   } else {
-    bcatfound = curcat;
+    bcatfound = true;
   }  
-  //alert(newcube.cats);
-  
   //alert("bfound=" + bfound);
   //alert("bcatfound=" + bcatfound);