Skip to content

Commit

Permalink
Hide unsupported field option tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Sep 9, 2024
1 parent d144079 commit 1aeeca1
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 @@ -436,7 +436,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 1aeeca1

Please sign in to comment.