fix for dragging from phantom square broken (again)

This commit is contained in:
Jesse D. McDonald 2020-05-09 12:53:45 -05:00
parent 21214dd5df
commit a523c81f88
1 changed files with 9 additions and 2 deletions

View File

@ -91,7 +91,14 @@ $(function (){
let square = $('#cb_phantom'); let square = $('#cb_phantom');
if (square.length < 1) { if (square.length < 1) {
square = $(`<div id="cb_phantom" class="cb-phantom"></div>`); square = $(`<div id="cb_phantom" class="cb-phantom"></div>`);
square.hide().appendTo('body'); square.hide().appendTo('body').droppable({
accept: '.cb-piece',
disabled: true,
deactivate: function(ev, ui){
$(this).droppable('disable');
},
drop: squareDropDestination,
});
} }
return square; return square;
} else if (where.match(/^[a-h][1-8]$/)) { } else if (where.match(/^[a-h][1-8]$/)) {
@ -938,7 +945,7 @@ $(function (){
} }
} }
$('.cb-square, .cb-phantom').droppable({ $('.cb-square').droppable({
accept: '.cb-piece', accept: '.cb-piece',
disabled: true, disabled: true,
deactivate: function(ev, ui){ deactivate: function(ev, ui){