resize update -- adjust cards without delay
This commit is contained in:
parent
1ff51b826d
commit
9f6d8145df
2 changed files with 33 additions and 5 deletions
|
@ -46,11 +46,34 @@
|
||||||
display: block;
|
display: block;
|
||||||
width: 79px;
|
width: 79px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
margin: 3px 10px 0px 19px;
|
margin: 1px 10px 0px 19px;
|
||||||
|
|
||||||
font-family: "Arial Rounded MT Bold" , arial, serif;
|
font-family: "Arial Rounded MT Bold" , arial, serif;
|
||||||
font-size: 10px;
|
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;
|
xtext-shadow: 0px 0px 1px #444;
|
||||||
|
|
||||||
|
|
|
@ -609,7 +609,7 @@ function calcCardOffset() {
|
||||||
if(col.offset().left + col.outerWidth() > card.offset().left + card.outerWidth() || i === $(".col").size() - 1) {
|
if(col.offset().left + col.outerWidth() > card.offset().left + card.outerWidth() || i === $(".col").size() - 1) {
|
||||||
offsets[card.attr('id')] = {
|
offsets[card.attr('id')] = {
|
||||||
col: col,
|
col: col,
|
||||||
x: card.offset().left - col.offset().left
|
x: ( (card.offset().left - col.offset().left) / col.outerWidth() )
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,7 @@ function adjustCard(offsets) {
|
||||||
var data = {
|
var data = {
|
||||||
id: this.id,
|
id: this.id,
|
||||||
position: {
|
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))
|
top: parseInt(card.css('top').slice(0,-2))
|
||||||
},
|
},
|
||||||
oldposition: {
|
oldposition: {
|
||||||
|
@ -635,7 +635,9 @@ function adjustCard(offsets) {
|
||||||
}
|
}
|
||||||
}; //use .css() instead of .position() because css' rotate
|
}; //use .css() instead of .position() because css' rotate
|
||||||
console.log(data);
|
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);
|
sendAction('moveCard', data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -788,6 +790,9 @@ $( ".board-outline" ).resizable( {
|
||||||
|
|
||||||
$(".board-outline").bind("resizestart", function() {
|
$(".board-outline").bind("resizestart", function() {
|
||||||
offsets = calcCardOffset();
|
offsets = calcCardOffset();
|
||||||
|
});
|
||||||
|
$(".board-outline").bind("resize", function(event, ui) {
|
||||||
|
adjustCard(offsets);
|
||||||
});
|
});
|
||||||
$(".board-outline").bind("resizestop", function(event, ui) {
|
$(".board-outline").bind("resizestop", function(event, ui) {
|
||||||
boardResizeHappened(event, ui);
|
boardResizeHappened(event, ui);
|
||||||
|
|
Loading…
Add table
Reference in a new issue