From 9f6d8145df3080770f43d816822e6c910bce690f Mon Sep 17 00:00:00 2001 From: Ali Asaria Date: Thu, 23 Jun 2011 01:04:09 -0400 Subject: [PATCH] resize update -- adjust cards without delay --- client/css/smallcards.css | 27 +++++++++++++++++++++++++-- client/script.js | 11 ++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/client/css/smallcards.css b/client/css/smallcards.css index 7b17d34..c8c93cf 100644 --- a/client/css/smallcards.css +++ b/client/css/smallcards.css @@ -46,16 +46,39 @@ display: block; width: 79px; height: 45px; - margin: 3px 10px 0px 19px; + margin: 1px 10px 0px 19px; font-family: "Arial Rounded MT Bold" , arial, serif; font-size: 10px; - letter-spacing: 0px; + letter-spacing: 0px; + line-height: 9px; xtext-shadow: 0px 0px 1px #444; opacity: 1; + color: #333; + text-align: center; + padding-top: 8px; +} + + +.xcontent { + overflow: hidden; + display: block; + width: 79px; + height: 45px; + margin: 0px 10px 0px 19px; + + font-family: "Arial Rounded MT Bold", "Arial" , arial, serif; + xfont-size: 10px; + letter-spacing: 0px; + line-height: 8px; + + xtext-shadow: 0px 0px 1px #444; + + opacity: 1; + color: #333; text-align: center; padding-top: 8px; diff --git a/client/script.js b/client/script.js index 04f18a3..04eeee8 100644 --- a/client/script.js +++ b/client/script.js @@ -609,7 +609,7 @@ function calcCardOffset() { if(col.offset().left + col.outerWidth() > card.offset().left + card.outerWidth() || i === $(".col").size() - 1) { offsets[card.attr('id')] = { col: col, - x: card.offset().left - col.offset().left + x: ( (card.offset().left - col.offset().left) / col.outerWidth() ) } return false; } @@ -626,7 +626,7 @@ function adjustCard(offsets) { var data = { id: this.id, position: { - left: offset.col.position().left + offset.x, + left: offset.col.position().left + (offset.x * offset.col.outerWidth()), top: parseInt(card.css('top').slice(0,-2)) }, oldposition: { @@ -635,7 +635,9 @@ function adjustCard(offsets) { } }; //use .css() instead of .position() because css' rotate console.log(data); - moveCard(card, data.position); + //moveCard(card, data.position); + card.css('left',data.position.left); + card.css('top',data.position.top); sendAction('moveCard', data); } }); @@ -788,6 +790,9 @@ $( ".board-outline" ).resizable( { $(".board-outline").bind("resizestart", function() { offsets = calcCardOffset(); + }); + $(".board-outline").bind("resize", function(event, ui) { + adjustCard(offsets); }); $(".board-outline").bind("resizestop", function(event, ui) { boardResizeHappened(event, ui);