Show the vehicle/ordnance type in the main sortable lists.

master
Pacman Ghost 4 years ago
parent e8e720a229
commit 0afed8ac2d
  1. 1
      vasl_templates/webapp/static/css/tabs-ob.css
  2. 11
      vasl_templates/webapp/static/vo.js

@ -25,6 +25,7 @@
.panel-ob_vo .sortable .vo-entry img.vasl-image { display: inline-block ; vertical-align: middle ; height: 3.25em ; margin-right: 0.5em ; }
.panel-ob_vo .sortable .vo-entry.small-piece img.vasl-image { height: 2.25em ; margin-left: 0.5em ; margin-right: 0.75em ; }
.panel-ob_vo .sortable .vo-entry .detail { flex-grow: 1 ; display: flex ; flex-direction: column ; justify-content: center ; }
.panel-ob_vo .sortable .vo-entry .detail .vo-type { font-style: italic ; font-size: 80% ; color: #666 ; }
.panel-ob_vo .sortable .vo-entry .detail .vo-capabilities { max-height: 2.5em ; overflow: hidden ; font-size: 80% ; font-style: italic ; }
.panel-ob_vo .sortable .vo-entry .detail .vo-capability { margin-right: 0.5em ; color: #444 ; }
.panel-ob_vo label.header { font-weight: bold ; display: inline-block ; width: 3.25em ; }

@ -189,7 +189,7 @@ function do_add_vo( vo_type, player_no, vo_entry, vo_image_id, elite, custom_cap
var buf = [ div_tag,
"<img class='vasl-image'>",
"<div class='detail'>",
"<div class='vo-name'></div>",
"<div class='caption'></div>",
"<div class='vo-capabilities'></div>",
"</div>"
] ;
@ -262,10 +262,13 @@ function update_vo_sortable2_entry( $entry, vo_type, snippet_params )
var url = get_vo_image_url( vo_entry, vo_image_id, true, false ) ;
var $content = $entry.children( ".vo-entry" ) ;
$content.find( "img.vasl-image" ).attr( "src", url ) ;
var name = vo_entry.name ;
var caption = "<span class='vo-name'>" + vo_entry.name ;
if ( data.elite )
name += " \u24ba" ;
$content.find( "div.vo-name" ).html( name ) ;
caption += " \u24ba" ;
caption += "</span>" ;
if ( vo_entry.type )
caption += " <span class='vo-type'>(" + vo_entry.type + ")</span>" ;
$content.find( "div.caption" ).html( caption ) ;
for ( var i=0 ; i < capabilities.length ; ++i )
capabilities[i] = "<span class='vo-capability'>" + capabilities[i] + "</span>" ;
$content.find( "div.vo-capabilities" ).html( capabilities.join("") ) ;

Loading…
Cancel
Save