From 749d543d6a604cc62f0cb189d9f3eccd828f8c40 Mon Sep 17 00:00:00 2001 From: Taka Date: Wed, 24 Jul 2019 06:29:06 +0000 Subject: [PATCH] Detect sortable2 entries correctly. --- vasl_templates/webapp/static/simple_notes.js | 2 +- vasl_templates/webapp/static/vo.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vasl_templates/webapp/static/simple_notes.js b/vasl_templates/webapp/static/simple_notes.js index 2289460..2cdc625 100644 --- a/vasl_templates/webapp/static/simple_notes.js +++ b/vasl_templates/webapp/static/simple_notes.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" ) ; diff --git a/vasl_templates/webapp/static/vo.js b/vasl_templates/webapp/static/vo.js index abb7fd6..4d5571a 100644 --- a/vasl_templates/webapp/static/vo.js +++ b/vasl_templates/webapp/static/vo.js @@ -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" ) ;