Browse Source

Correction Drag & Drop

Loquicom 11 months ago
parent
commit
dc0b201a62
1 changed files with 2 additions and 2 deletions
  1. 2 2
      boulier.js

+ 2 - 2
boulier.js

@@ -150,13 +150,13 @@ class Boulier {
             let changeColor = Math.round(this._ball / this.color[i].length);
             for(let j = 0; j < this.boulier[i].length; j++) {
                 const elt = this.boulier[i][j];
-                html += '<div class="cell"><div class="line" data-line="' + i + '" data-col="' + j + '" ondragover="allowDrop(event)" ondrop="ballDrop(event, this)""></div>';
+                html += '<div class="cell"><div class="line" data-line="' + i + '" data-col="' + j + '" ondragover="allowDrop(event)" ondrop="ballDrop(event, this)"></div>';
                 if (elt) {
                     let ballColor = this.color[i][Math.trunc(cptBall/changeColor)];
                     if (ballColor == null) {
                         ballColor = this.color[i][this.color[i].length - 1];
                     }
-                    html += '<div class="ball ' + ballColor + '" data-line="' + i + '" data-col="' + j + '" draggable="true" ondragstart="ballDrag(event)" onclick="ballClick(this)"></div>';
+                    html += '<div class="ball ' + ballColor + '" data-line="' + i + '" data-col="' + j + '" draggable="true" ondragstart="ballDrag(event)" ondragover="allowDrop(event)" ondrop="ballDrop(event, this)" onclick="ballClick(this)"></div>';
                     cptBall++;
                 }
                 html += '</div>';