improved tile move, added more tiles

This commit is contained in:
Stephan Richter
2020-09-14 00:01:48 +02:00
parent 6a1ada0d88
commit e7b9f3cd09
17 changed files with 153 additions and 37 deletions

View File

@@ -110,13 +110,17 @@ function moveTile(x,y){
method: POST,
data : {action:mode,direction:selected.id,x:x,y:y},
success: function(resp){
$(resp).each(function(){
if (this.id != undefined){
$('#'+this.id).remove();
$(BODY).append($(this));
}
});
$('#tile-'+x+'-'+y).remove();
if (resp.startsWith('<')){
$(resp).each(function(){
if (this.id != undefined){
$('#'+this.id).remove();
$(BODY).append($(this));
}
});
$('#tile-'+x+'-'+y).remove();
} else {
addMessage(resp);
}
}
});
}