make new cards start at more sane starting point

This commit is contained in:
ali asaria 2014-09-01 12:29:32 -04:00
parent 1c83ca056c
commit 9844cd3d84

View file

@ -162,10 +162,13 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed)
{
//cards[id] = {id: id, text: text, x: x, y: y, rot: rot, colour: colour};
var h = '<div id="' + id + '" class="card ' + colour + ' draggable" style="-webkit-transform:rotate(' + rot + 'deg);">\
var h = '<div id="' + id + '" class="card ' + colour +
' draggable" style="-webkit-transform:rotate(' + rot + 'deg);\
">\
<img src="/images/icons/token/Xion.png" class="card-icon delete-card-icon" />\
<img class="card-image" src="/images/' + colour + '-card.png">\
<div id="content:' + id + '" class="content stickertarget droppable">' + text + '</div>\
<div id="content:' + id + '" class="content stickertarget droppable">' +
text + '</div>\
</div>';
var card = $(h);
@ -239,6 +242,10 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed)
var speed = Math.floor(Math.random() * 1000);
if (typeof(animationspeed) != 'undefined') speed = animationspeed;
var startPosition = $("#create-card").position();
card.css( 'top' , startPosition.top - card.height()*.5 );
card.css('left', startPosition.left - card.width() *.5 );
card.animate({
left: x + "px",
@ -864,14 +871,3 @@ window.ondragstart = function() { return false; }
});