Skip to content
Browse files

resize update -- adjust cards without delay

  • Loading branch information...
1 parent 1ff51b8 commit 9f6d8145df3080770f43d816822e6c910bce690f Ali Asaria committed Jun 23, 2011
Showing with 33 additions and 5 deletions.
  1. +25 −2 client/css/smallcards.css
  2. +8 −3 client/script.js
View
27 client/css/smallcards.css
@@ -46,11 +46,12 @@
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;
@@ -59,4 +60,26 @@
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;
}
View
11 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);
}
});
@@ -789,6 +791,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);
adjustCard(offsets);

0 comments on commit 9f6d814

Please sign in to comment.
Something went wrong with that request. Please try again.