diff --git a/vasl_templates/webapp/static/sortable.js b/vasl_templates/webapp/static/sortable.js index e35c9cb..99e3d2e 100644 --- a/vasl_templates/webapp/static/sortable.js +++ b/vasl_templates/webapp/static/sortable.js @@ -191,9 +191,13 @@ $.fn.sortable2 = function( action, args ) // NOTE: We can't get height for sortable2's that are not visible (i.e. not in the active tab), // we update the heights dynamically as tabs are selected, and the window is resized. var available_height = $sortable2.parent().height() ; - var max_height = Math.max( available_height/$entries.length, 2*gEmSize ) ; + var max_height = Math.ceil( Math.max( available_height/$entries.length, 2*gEmSize ) ) ; $entries.each( function() { - $(this).css({ "max-height": Math.ceil(max_height)+"px", "overflow-y": "hidden" }) ; + var fixed_height = $(this).data( "sortable2-data" ).fixed_height ; + if ( fixed_height ) + $(this).css( "height", fixed_height+"px" ) ; + else + $(this).css({ "max-height": max_height+"px", "overflow-y": "hidden" }) ; // check for overflow var entry_height = $(this).height() ; var content_height = $(this).children("div").height() ; diff --git a/vasl_templates/webapp/static/vo.js b/vasl_templates/webapp/static/vo.js index dd7c259..f6e73fe 100644 --- a/vasl_templates/webapp/static/vo.js +++ b/vasl_templates/webapp/static/vo.js @@ -96,14 +96,19 @@ function add_vo( vo_type, player_no ) function do_add_vo( vo_type, player_no, entry ) { // add the specified vehicle/ordnance + // NOTE: We set a fixed height for the sortable2 entries (based on the CSS settings in tabs-ob.css), + // so that the vehicle/ordnance images won't get truncated if there are a lot of them. var $sortable2 = $( "#ob_" + vo_type + "-sortable_" + player_no ) ; var div_tag = "" + entry.name + "" ), - data: { caption: entry.name, vo_entry: entry }, + data: { caption: entry.name, vo_entry: entry, fixed_height: fixed_height }, } ) ; }