Skip to content

Commit

Permalink
Merge pull request alleyinteractive#475 from alleyinteractive/option-…
Browse files Browse the repository at this point in the history
…label-incr-for

Update label for attr in incrementable options
  • Loading branch information
danielbachhuber committed Feb 22, 2016
2 parents db3fcb1 + 9bd9736 commit 35d6c0f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/fieldmanager.js
Expand Up @@ -88,9 +88,13 @@ var fm_renumber = function( $wrappers ) {
$( this ).attr( 'name', new_fname );
if ( $( this ).attr( 'id' ) && $( this ).attr( 'id' ).match( '-proto' ) && ! new_fname.match( 'proto' ) ) {
$( this ).attr( 'id', 'fm-edit-dynamic-' + dynamic_seq );
var parent = $(this).closest( '.fm-item' );
if ( parent.find( '.fm-label label' ).length ) {
parent.find( '.fm-label label' ).attr( 'for', 'fm-edit-dynamic-' + dynamic_seq );
if ( $( this ).parent().hasClass( 'fm-option' ) ) {
$( this ).parent().find( 'label' ).attr( 'for', 'fm-edit-dynamic-' + dynamic_seq );
} else {
var parent = $( this ).closest( '.fm-item' );
if ( parent.length && parent.find( '.fm-label label' ).length ) {
parent.find( '.fm-label label' ).attr( 'for', 'fm-edit-dynamic-' + dynamic_seq );
}
}
dynamic_seq++;
return; // continue;
Expand Down

0 comments on commit 35d6c0f

Please sign in to comment.