From af6c4a1e38a21cc2ce46f096d11b3734f3a230c0 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Fri, 31 May 2024 15:20:02 +0530 Subject: [PATCH] fixed enter key conflict --- js/qsm-quiz.js | 13 +++++++------ php/admin/options-page-questions-tab.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index fb362c7aa..813635b4f 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1950,13 +1950,14 @@ function qsm_question_quick_result_js(question_id, answer, answer_type = '', sho } } -jQuery(document).on( 'click', '.qsm-quiz-container', function() { - jQuery('.qsm-quiz-container').removeClass('qsm-recently-active'); - jQuery(this).addClass('qsm-recently-active'); +jQuery(document).on('click', function(event) { + if (jQuery(event.target).closest('.qsm-quiz-container').length) { + jQuery('.qsm-quiz-container').removeClass('qsm-recently-active'); + jQuery(event.target).closest('.qsm-quiz-container').addClass('qsm-recently-active'); + } else { + jQuery('.qsm-quiz-container').removeClass('qsm-recently-active'); + } }); -if (jQuery('.qsm-quiz-container').length > 0) { - jQuery('body .qsm-quiz-container:first').addClass('qsm-recently-active'); -} jQuery(document).keydown(function(event) { if (jQuery('.qsm-quiz-container.qsm-recently-active').length) { diff --git a/php/admin/options-page-questions-tab.php b/php/admin/options-page-questions-tab.php index 901d8c979..d02928e44 100644 --- a/php/admin/options-page-questions-tab.php +++ b/php/admin/options-page-questions-tab.php @@ -709,7 +709,7 @@ class="save-page-button button button-primary">
information - %s', esc_url( qsm_get_plugin_link( 'downloads/wordpress-quiz-timer-advanced', 'advanced-timer-popup', 'quiz_editor', 'get_addon', 'qsm_plugin_upsell' ) ), __( 'Get this add-on ', 'quiz-master-next' ) ); esc_html_e( 'and extend your quiz features.', 'quiz-master-next' ); ?> + %s', esc_url( qsm_get_plugin_link( 'downloads/wordpress-quiz-timer-advanced', 'advanced-timer-popup', 'quiz_editor', 'get_addon', 'qsm_plugin_upsell' ) ), esc_html__( 'Get this add-on ', 'quiz-master-next' ) ); esc_html_e( 'and extend your quiz features.', 'quiz-master-next' ); ?>