15
vendor/js/faq.js
vendored
15
vendor/js/faq.js
vendored
@ -100,9 +100,18 @@ function openReadMoreModal( id )
|
||||
readMoreModalTitle.html( 'Question from: Anonymous' );
|
||||
request( 'getQuestion', {"question_id":id}, function( result )
|
||||
{
|
||||
let _answer = '';
|
||||
if( result.data.answer === null || result.data.answer.length < 5 )
|
||||
{
|
||||
_answer = 'So far there is no answer to this question.';
|
||||
}
|
||||
else
|
||||
{
|
||||
_answer = result.data.answer;
|
||||
}
|
||||
readMoreModalTitle.html( 'Question from: ' + result.data.created_by );
|
||||
readMoreModalText.html( '<strong>Question</strong><br>' + result.data.question +
|
||||
'<hr><strong>Answer</strong><br>' + result.data.answer
|
||||
'<hr><strong>Answer</strong><br>' + _answer
|
||||
);
|
||||
}, function() {
|
||||
readMoreModalText.html( 'An error occurred, please try again later!' );
|
||||
@ -120,6 +129,10 @@ function openAnswerModal( id )
|
||||
request( 'getQuestion', {"question_id":id}, function( result )
|
||||
{
|
||||
readMoreModalTitle.html( 'Answer ' + result.data.created_by + " question" );
|
||||
if( result.data.answer !== null && result.data.answer.length > 5 )
|
||||
{
|
||||
answerText.val( result.data.answer );
|
||||
}
|
||||
answer_id = result.data.id;
|
||||
}, function() {
|
||||
answerErrorMsg.html( 'An error occurred, please try again!' );
|
||||
|
Reference in New Issue
Block a user