File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,7 +132,6 @@ body.night .search-hot-text ul li:hover {
132132 font-size : 12px ;
133133 line-height : 20px ;
134134 text-align : center;
135- background : # e5e5e5 ;
136135 margin-right : 10px ;
137136 border-radius : 10px ;
138137 color : # 999 ;
Original file line number Diff line number Diff line change @@ -3155,9 +3155,16 @@ function search() {
31553155 $ ( '#box' ) . css ( 'display' , 'block' ) ;
31563156 for ( let i = 0 ; i < res . length ; i ++ ) {
31573157 const { url, title, des, src } = res [ i ] ;
3158- $ ( '#box ul' ) . append (
3159- `<li><span><img class="img-circle" src="${ src } " /></span> <a href="${ url } " target="_blank" title="${ des } ">${ title } <small>${ des } </small></a></li>`
3160- ) ;
3158+ if ( src ) {
3159+ $ ( '#box ul' ) . append (
3160+ `<li><span><img class="img-circle" src="${ src } " /></span> <a href="${ url } " target="_blank" title="${ des } ">${ title } <small>${ des } </small></a></li>`
3161+ ) ;
3162+ } else {
3163+ const tit = title . substring ( 0 , 1 ) ;
3164+ $ ( '#box ul' ) . append (
3165+ `<li><span class="img-circle no-img">${ tit } </span> <a href="${ url } " target="_blank" title="${ des } ">${ title } <small>${ des } </small></a></li>`
3166+ ) ;
3167+ }
31613168 }
31623169 } else {
31633170 $ ( '#box' ) . css ( 'display' , 'none' ) ;
You can’t perform that action at this time.
0 commit comments