Skip to content

Commit

Permalink
Fixed "add new" button not appearing for nested groups with "max_clone".
Browse files Browse the repository at this point in the history
  • Loading branch information
rilwis committed Jan 22, 2018
1 parent 3ee0b91 commit f41d529
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/clone.js
Expand Up @@ -181,9 +181,9 @@ jQuery( function ( $ ) {
* @param $container .rwmb-input container
*/
function toggleAddButton( $container ) {
var $button = $container.find( '.add-clone' ),
var $button = $container.children( '.add-clone' ),
maxClone = parseInt( $container.data( 'max-clone' ) ),
numClone = $container.find( '.rwmb-clone' ).length;
numClone = $container.children( '.rwmb-clone' ).length;

$button.toggle( isNaN( maxClone ) || ( maxClone && numClone < maxClone ) );
}
Expand Down

0 comments on commit f41d529

Please sign in to comment.