allow board resizing

This commit is contained in:
Ali Asaria 2011-05-27 01:08:25 -04:00
parent efb28ac4f1
commit 431f0e76d6
3 changed files with 68 additions and 1 deletions

View file

@ -119,6 +119,10 @@ function getMessage( m )
addSticker( message.data.cardId, message.data.stickerId );
break;
case 'setBoardSize':
resizeBoard( message.data );
break;
default:
//unknown message
alert('unknown action: ' + JSON.stringify(message));
@ -533,6 +537,23 @@ function updateName ( sid, name )
$('#names-ul').children(id).text( name );
}
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
function boardResizeHappened(event, ui)
{
var newsize = ui.size
sendAction( 'setBoardSize', newsize);
}
function resizeBoard (size) {
$( ".board-outline" ).animate( {
height: size.height,
width: size.width
} );
}
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
@ -661,7 +682,17 @@ $( ".sticker" ).draggable({
});
$( ".board-outline" ).resizable( { ghost: false, minWidth: 700, minHeight: 400 , maxWidth: 3200, maxHeight: 1800} );
$( ".board-outline" ).resizable( {
ghost: false,
minWidth: 700,
minHeight: 400 ,
maxWidth: 3200,
maxHeight: 1800,
stop: function(event, ui) {
boardResizeHappened(event, ui);
}
} );
});