FEATURE: hide excerpt if 'solved_quote_length' is set to zero
This commit is contained in:
parent
6ab44835b8
commit
9104e2292c
|
@ -102,8 +102,9 @@ function initializeWithApi(api) {
|
|||
if (postModel) {
|
||||
const topic = postModel.get('topic');
|
||||
if (topic.get('accepted_answer')) {
|
||||
const hasExcerpt = !!topic.get('accepted_answer').excerpt;
|
||||
|
||||
var rawhtml = `
|
||||
const withExcerpt = `
|
||||
<aside class='quote' data-post="${topic.get('accepted_answer').post_number}" data-topic="${topic.get('id')}">
|
||||
<div class='title'>
|
||||
${topic.get('acceptedAnswerHtml')} <div class="quote-controls"><\/div>
|
||||
|
@ -113,7 +114,14 @@ function initializeWithApi(api) {
|
|||
</blockquote>
|
||||
</aside>`;
|
||||
|
||||
var cooked = new PostCooked({cooked:rawhtml});
|
||||
const withoutExcerpt = `
|
||||
<aside class='quote'>
|
||||
<div class='title title-only'>
|
||||
${topic.get('acceptedAnswerHtml')}
|
||||
</div>
|
||||
</aside>`;
|
||||
|
||||
var cooked = new PostCooked({ cooked: hasExcerpt ? withExcerpt : withoutExcerpt });
|
||||
|
||||
var html = cooked.init();
|
||||
|
||||
|
|
|
@ -38,3 +38,7 @@
|
|||
//border-top: 1px solid #ddd;
|
||||
//background-color: #E9FFE0;
|
||||
}
|
||||
|
||||
aside.quote .title.title-only {
|
||||
padding: 12px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue