Skip to content

Commit

Permalink
Merge pull request #356 from Codeinwp/bugfix/420
Browse files Browse the repository at this point in the history
Hide unsupported field option tabs
  • Loading branch information
selul authored Sep 23, 2024
2 parents f15c7be + 1aeeca1 commit 22cacd8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion js/admin/ppom-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,18 @@ jQuery(function($) {

var field_model_id = 'ppom_field_model_' + field_no + '';

clone_new_field.find('.ppom_save_fields_model').end().appendTo('.ppom_save_fields_model').attr('id', field_model_id);
clone_new_field.find('.ppom_save_fields_model')
.end()
.appendTo('.ppom_save_fields_model')
.attr('id', field_model_id)
.find( '.ppom-tabs-header label.ppom-tabs-label' )
.each( function( index, item ) {
var tabId = $(item).attr('id');
var hasTabOptions = $( '#' + field_model_id, document )?.find( '.ppom_handle_' + tabId )?.length > 0;
if ( ! hasTabOptions ) {
$(item).hide();
}
} );
clone_new_field.find('.ppom-field-checker').attr('data-field-index', field_no);
clone_new_field.find('.ppom-field-checker').addClass('ppom-add-fields-js-action');

Expand Down

0 comments on commit 22cacd8

Please sign in to comment.