Skip to content

Commit

Permalink
fix/#782_openai_checklist_button_does_not_work_on_second_tab (#795)
Browse files Browse the repository at this point in the history
* fix custom tab not shown

* remove unused code
  • Loading branch information
richaferry authored Oct 10, 2024
1 parent 73c5014 commit 652d8af
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions modules/checklists/assets/js/global-checklists.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@
$suggestionsObject = objectL10n_checklists_global_checklist[type + '_suggestions'],
rule;

$table.append($tr);
$table.find('tbody#pp-checklists-tab-body-' + post_type).append($tr);
$table.find('tr.ppch-custom-group:contains("No custom requirements for this post type.")').hide();

$tr
.addClass('pp-checklists-requirement-row')
Expand Down Expand Up @@ -337,8 +338,6 @@

/*---------- Custom items ----------*/
$('#pp-checklists-add-button').on('click', function (event) {
//hide all tabs contents, and show Custom tab
$('.pp-checklists-requirement-row').hide();
$('.ppch-custom-group').show();

var newId = uidGen(15);
Expand All @@ -363,7 +362,7 @@
//add active class to current tab
$(this).addClass('active');

//hide all tabs contents
// hide all tabs contents
$('.pp-checklists-requirement-row').hide();

// Show the current tab contents that also have the matching data-post-type attribute
Expand All @@ -372,8 +371,6 @@

/*---------- OpenAI items ----------*/
$('#pp-checklists-openai-promt-button').on('click', function (event) {
//hide all tabs contents, and show Custom tab
$('.pp-checklists-requirement-row').hide();
$('.ppch-custom-group').show();

var newId = uidGen(15);
Expand Down

0 comments on commit 652d8af

Please sign in to comment.