Skip to content

Commit

Permalink
Merge pull request #1150 from drgrice1/feedback-non-empty-messages
Browse files Browse the repository at this point in the history
Only show non empty messages in feedback.
  • Loading branch information
Alex-Jordan authored Nov 29, 2024
2 parents 67ef44f + eabc850 commit 7d382fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions macros/PG.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1198,9 +1198,9 @@ sub ENDDOCUMENT {
'button',
type => 'button',
class => "ww-feedback-btn btn btn-sm $options{btnClass} $options{btnAddClass}"
. ($rh_envir->{showMessages} && $ansHash->{ans_message} ? ' with-message' : ''),
. ($rh_envir->{showMessages} && $ansHash->{ans_message} =~ /\S/ ? ' with-message' : ''),
'aria-label' => (
$rh_envir->{showMessages} && $ansHash->{ans_message}
$rh_envir->{showMessages} && $ansHash->{ans_message} =~ /\S/
? maketext('[_1] with message', $options{resultTitle})
: $options{resultTitle}
),
Expand Down Expand Up @@ -1238,7 +1238,7 @@ sub ENDDOCUMENT {
class => 'card',
sub {
(
$rh_envir->{showMessages} && $ansHash->{ans_message}
$rh_envir->{showMessages} && $ansHash->{ans_message} =~ /\S/
? $feedbackLine->(
'', $ansHash->{ans_message} =~ s/\n/<br>/gr,
'feedback-message'
Expand Down

0 comments on commit 7d382fb

Please sign in to comment.