Skeleton placeholder for search suggestion

This commit is contained in:
alistair3149 2019-12-31 13:43:38 -05:00
parent 2257e64671
commit 6f3a161433
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C
2 changed files with 17 additions and 2 deletions

View file

@ -224,6 +224,21 @@ a.suggestion-link:hover {
left: 0;
}
.suggestion-placeholder {
.suggestion-title {
width: 30%;
height: 1.6rem * @content-scaling;
}
.suggestion-description {
width: 70%;
height: 1.3rem * @content-scaling;
}
.suggestion-title,
.suggestion-description {
background-color: @base-90;
}
}
// RTL tweaks
.rtl {
#site-search {

View file

@ -244,7 +244,7 @@ window.WMTypeAhead = function ( appendTo, searchInput ) {
* Card displayed if no results could be found
* @returns {string}
*/
function getNoResultsIndicator() {
function getNoResultsIndicator( searchString ) {
const titlemsg = mw.message('citizen-search-no-results-title').plain(),
descmsg = mw.message('citizen-search-no-results-desc').plain();
@ -357,7 +357,7 @@ window.WMTypeAhead = function ( appendTo, searchInput ) {
i;
if (suggestions.length === 0){
return getNoResultsIndicator();
return getNoResultsIndicator( searchString );
}
for ( i = 0; i < suggestions.length; i++ ) {