preparing property dialog

This commit is contained in:
Stephan Richter
2020-09-13 01:14:46 +02:00
parent c3d40a66fb
commit b14b8fff15
6 changed files with 72 additions and 40 deletions

View File

@@ -75,6 +75,23 @@ svg text{
background: yellow;
}
#tile-properties{
position: fixed;
top: 10px;
bottom: 10px;
left: 10px;
right: 10px;
background: yellow;
}
.closebtn{
position: absolute;
right: 10px;
font-size: 30px;
background: gray;
color: white;
}
#Eraser polygon{
stroke: red;
}

View File

@@ -31,16 +31,34 @@ function addTile(x,y){
}
function bodyClick(ev){
console.log('bodyClick:',ev);
//console.log('bodyClick:',ev);
switch (mode){
case undefined:
case null: return;
case undefined:
case null:
return clickTile(ev.clientX,ev.clientY);
case ADD:
return addTile(ev.clientX,ev.clientY);
}
console.log(ev.clientX,ev.clientY);
}
function clickTile(x,y){
console.log("clickTile:",x,y);
x = Math.floor(x/SQUARE);
y = Math.floor(y/SQUARE);
if ($('#tile-'+x+'-'+y).length > 0){
$.ajax({
url : PLAN,
method : POST,
data : {action:'openProps',x:x,y:y},
success: function(resp){
$('body').append($(resp));
}
});
}
return false;
}
function closeMenu(ev){
console.log('closeMenu:',ev);
if (selected != null) $(selected).css('border','');