Detect sortable2 entries correctly.

master
Pacman Ghost 5 years ago
parent 76b7d9836a
commit 749d543d6a
  1. 2
      vasl_templates/webapp/static/simple_notes.js
  2. 4
      vasl_templates/webapp/static/vo.js

@ -90,7 +90,7 @@ function _do_edit_simple_note( $sortable2, $entry, default_width )
data = { caption: caption, width: width } ;
if ( note_type === "scenario_notes" || note_type === "ob_setups" || note_type === "ob_notes" ) {
var usedIds = {} ;
$sortable2.find( "li" ).each( function() {
$sortable2.children( "li" ).each( function() {
usedIds[ $(this).data("sortable2-data").id ] = true ;
} ) ;
data.id = auto_assign_id( usedIds, "id" ) ;

@ -112,7 +112,7 @@ function add_vo( vo_type, player_no )
var sel_index = $elem.children( ".vo-entry" ).data( "index" ) ;
var sel_entry = entries[ sel_index ] ;
var usedVoIds = [] ;
$sortable2.find( "li" ).each( function() {
$sortable2.children( "li" ).each( function() {
usedVoIds.push( $(this).data( "sortable2-data" ).vo_entry.id ) ;
} ) ;
// check for duplicates
@ -147,7 +147,7 @@ function do_add_vo( vo_type, player_no, vo_entry, vo_image_id, elite, custom_cap
if ( seq_id === null ) {
// auto-assign a sequence ID
var usedSeqIds = {} ;
$sortable2.find( "li" ).each( function() {
$sortable2.children( "li" ).each( function() {
usedSeqIds[ $(this).data( "sortable2-data" ).id ] = true ;
} ) ;
seq_id = auto_assign_id( usedSeqIds, "seq_id" ) ;

Loading…
Cancel
Save