Fix the bug that the deprecated mark disappears after searching for item .

This commit is contained in:
shalousun 2021-09-04 14:55:00 +08:00
parent 79abbcd876
commit f26abd5ad2
1 changed files with 17 additions and 3 deletions

View File

@ -17,6 +17,8 @@ api[${apiGroupLP.dataIndex}].list.push({
<%for(doc in api.list) {%> <%for(doc in api.list) {%>
api[${apiGroupLP.dataIndex}].list[${apiLP.dataIndex}].list.push({ api[${apiGroupLP.dataIndex}].list[${apiLP.dataIndex}].list.push({
order: '${doc.order}', order: '${doc.order}',
deprecated: '${doc.deprecated}',
url: '${doc.url}',
desc: '${strUtil.replace(removeLineBreaks(doc.desc), "\'", "\\'")}', desc: '${strUtil.replace(removeLineBreaks(doc.desc), "\'", "\\'")}',
}); });
<%}%> <%}%>
@ -127,7 +129,13 @@ function buildAccordion(apiGroups, liClass, display) {
html += '<ul class="sectlevel2" style="'+display+'">'; html += '<ul class="sectlevel2" style="'+display+'">';
doc = apiData[j].list; doc = apiData[j].list;
for (let m = 0; m < doc.length; m++) { for (let m = 0; m < doc.length; m++) {
html += '<li><a href="#_' + apiData[j].order + '_' + doc[m].order + '_' + doc[m].desc + '">' + apiData[j].order + '.' + doc[m].order + '.&nbsp;' + doc[m].desc + '</a> </li>'; let spanString;
if (doc[m].deprecated == 'true') {
spanString='<span class="line-through">';
} else {
spanString='<span>';
}
html += '<li><a href="#_' + apiData[j].order + '_' + doc[m].order + '_' + doc[m].href + '">' + apiData[j].order + '.' + doc[m].order + '.&nbsp;' + spanString + doc[m].desc + '<span></a> </li>';
} }
html += '</ul>'; html += '</ul>';
html += '</li>'; html += '</li>';
@ -146,8 +154,14 @@ function buildAccordion(apiGroups, liClass, display) {
html += '<ul class="sectlevel2" style="'+display+'">'; html += '<ul class="sectlevel2" style="'+display+'">';
doc = apiData[j].list; doc = apiData[j].list;
for (let m = 0; m < doc.length; m++) { for (let m = 0; m < doc.length; m++) {
html += '<li><a href="#_' + apiData[j].order + '_' + doc[m].order + '_' + doc[m].desc + '">' +apiGroup.order+'.'+ apiData[j].order + '.' + doc[m].order + '.&nbsp;' + doc[m].desc + '</a> </li>'; let spanString;
} if (doc[m].deprecated == 'true') {
spanString='<span class="line-through">';
} else {
spanString='<span>';
}
html += '<li><a href="#_' + apiData[j].order + '_' + doc[m].order + '_' + doc[m].href + '">' + apiData[j].order + '.' + doc[m].order + '.&nbsp;' + spanString + doc[m].desc + '<span></a> </li>';
}
html += '</ul>'; html += '</ul>';
html += '</li>'; html += '</li>';
} }