Added icon to fulltext search suggestion

This commit is contained in:
alistair3149 2020-06-08 00:27:25 -04:00
parent d0d379da52
commit a6d42a419e
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C
5 changed files with 18 additions and 4 deletions

View file

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="#36c" d="M7.5 13c3.04 0 5.5-2.46 5.5-5.5S10.54 2 7.5 2 2 4.46 2 7.5 4.46 13 7.5 13zm4.55.46A7.432 7.432 0 017.5 15C3.36 15 0 11.64 0 7.5S3.36 0 7.5 0C11.64 0 15 3.36 15 7.5c0 1.71-.57 3.29-1.54 4.55l6.49 6.49-1.41 1.41-6.49-6.49z"/><path fill="#36c" d="M4.00000005 5h7.0000002v1.00000005h-7.0000002zM4.00000005 6.99999995h7.0000002V8h-7.0000002zm0 1.99999995h5.44444499v.9999999H4.00000005z"/></svg>

After

Width:  |  Height:  |  Size: 471 B

View file

@ -231,7 +231,10 @@ window.WMTypeAhead = function ( appendTo, searchInput ) {
href = searchurl + searchString + '&fulltext=1';
return '<a id="suggestion-special" href="' + href + '">' +
'<div id="suggestion-special-text">' + msg + '&nbsp;<em class="suggestion-highlight">' + searchString + '</em></div>' +
'<div id="suggestion-special-icon"></div>' +
'<div id="suggestion-special-text">' + msg +
'&nbsp;<em class="suggestion-highlight">' +searchString +
'</em></div>' +
'</div>';
}

View file

@ -73,10 +73,19 @@
#suggestion-special {
padding: 1rem;
display: block;
display: flex;
color: @base-10;
align-items: center;
&-icon {
margin: 0 14px 0 10px;
width: 20px;
height: 20px;
background-repeat: no-repeat;
}
&-text {
padding: 5px 0; // make it looks more center aligned
font-size: @content-caption-size;
font-family: @fonts;
font-weight: bold;

View file

@ -348,10 +348,11 @@
},
"skins.citizen.icons.search": {
"class": "ResourceLoaderImageModule",
"selector": ".suggestion-thumbnail",
"selector": "{name}",
"useDataURI": false,
"images": {
"noimage": "resources/images/cards/noimage.svg"
".suggestion-thumbnail": "resources/skins.citizen.icons.search/noimage.svg",
"#suggestion-special-icon": "resources/skins.citizen.icons.search/searchfulltext.svg"
}
}
},