diff --git a/css/common.css b/css/common.css index 78469a2da..d91d2bf8f 100644 --- a/css/common.css +++ b/css/common.css @@ -256,7 +256,7 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover { align-content: center; } .qsm-quiz-container .qsm-contact-type-checkbox input { - margin: 0 5px 0 3px; + margin: 0 5px 6px 3px; } .mlw_qmn_question_number { font-weight: bold; diff --git a/js/qsm-admin.js b/js/qsm-admin.js index 62b2d07c4..a6f76188a 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -4115,4 +4115,28 @@ var import_button; }); } ); +}(jQuery)); + +(function ($) { + $(document).ready(function() { + var $settingsFields = $('.settings-field'); + var $popups = $('.qsm-contact-form-field-settings'); + + // Function to hide all popups + function qsmHideAllPopups() { + $popups.hide(); + } + + // Close popup on document click if popup is open and clicking outside + $(document).on('click', function(event) { + if (!$settingsFields.is(event.target) && $settingsFields.has(event.target).length === 0) { + qsmHideAllPopups(); + } + }); + + // Prevent the click event from propagating to the document when clicking inside the popup + $popups.on('click', function(event) { + event.stopPropagation(); + }); + }); }(jQuery)); \ No newline at end of file diff --git a/php/classes/class-qsm-contact-manager.php b/php/classes/class-qsm-contact-manager.php index d644d84b4..70e7ba61d 100644 --- a/php/classes/class-qsm-contact-manager.php +++ b/php/classes/class-qsm-contact-manager.php @@ -413,6 +413,8 @@ public static function generate_contact_field( $field, $index, $quiz_options, $d $class .= ' mlwRequiredRadio '; }elseif ( 'select' === $field["type"] ) { $class .= 'qsmRequiredSelect'; + }elseif ( 'number' === $field["type"] ) { + $class .= 'mlwRequiredNumber'; }else { $class .= 'mlwRequiredText qsm_required_text'; if ( 'checkbox' === $field["type"] ) { @@ -552,7 +554,7 @@ public static function generate_contact_field( $field, $index, $quiz_options, $d ?> - maxlength='' oninput='maxLengthCheck(this)' /> + maxlength='' oninput='maxLengthCheck(this)' />