From 1aeeca1a1142a140d6cb00006278afd2dbd341c4 Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Mon, 9 Sep 2024 12:28:59 +0530 Subject: [PATCH] Hide unsupported field option tabs --- js/admin/ppom-admin.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/js/admin/ppom-admin.js b/js/admin/ppom-admin.js index 23f5c1d9..8d4724f4 100644 --- a/js/admin/ppom-admin.js +++ b/js/admin/ppom-admin.js @@ -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');