File tree Expand file tree Collapse file tree 2 files changed +43
-20
lines changed Expand file tree Collapse file tree 2 files changed +43
-20
lines changed Original file line number Diff line number Diff line change 2222 padding : 0 ;
2323}
2424
25+ .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion__main {
26+ padding : 0 0 14px 0 ;
27+ }
28+
29+ .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion : not (.algolia-docsearch-suggestion__main ) {
30+ padding : 14px 0 ;
31+ border-top : 1px solid # E0E0E8 ;
32+ }
33+
2534.md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion__main .algolia-docsearch-suggestion--category-header {
2635 display : flex;
2736 align-items : center;
2837 font-size : 14px ;
2938 line-height : 21px ;
3039 letter-spacing : 0.12px ;
3140 height : 40px ;
32- margin : 16px 0 0 0 ;
41+ margin : 16px 0 ;
3342 padding : 0 40px ;
3443 border : 0 ;
3544 background-color : # F2F2F5 ;
4554 padding : 0 ;
4655}
4756
48- .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column {
57+ .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--content {
4958 float : none;
5059 width : 100% ;
5160 text-align : left;
61+ padding : 0 ;
62+ margin : 0 40px ;
63+ color : var (--ibexa-dusk-black );
64+ }
65+
66+ .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--title {
5267 font-size : 18px ;
5368 line-height : 20px ;
5469 letter-spacing : 0.12px ;
55- margin : 24px 40px 4px ;
56- padding : 0 ;
57- color : var (--ibexa-dusk-black );
5870 font-weight : 600 ;
5971}
6072
61- .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--content {
73+ .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column {
6274 float : none;
6375 width : 100% ;
6476 text-align : left;
6577 color : # 3B424A ;
66- font-size : 14 px ;
78+ font-size : 12 px ;
6779 line-height : 21px ;
6880 letter-spacing : 0.12px ;
6981 padding : 0 ;
70- margin : 0 40px ;
82+ margin : 0 px 40px 4 px ;
7183 display : flex;
7284 flex-direction : column-reverse;
7385}
7688 display : none;
7789}
7890
79- .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--title {
80- font-size : 12px ;
91+ .md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--text {
92+ color : # 3B424A ;
93+ font-size : 14px ;
8194 line-height : 21px ;
8295 letter-spacing : 0.12px ;
83- margin-top : 16px ;
84- font-weight : 500 ;
96+ margin-top : 10px ;
97+ padding-left : 10px ;
98+ border-left : 2px solid var (--mid-grey );
8599}
86100
87101.md-header .md-search .algolia-autocomplete .algolia-docsearch-suggestion .aa-suggestion-title-separator {
88- margin : 0 12px ;
89- font-weight : 500 ;
102+ padding : 0 10px ;
90103}
91104
92105.md-header .md-search .algolia-autocomplete .ds-dataset-1 {
Original file line number Diff line number Diff line change @@ -144,12 +144,22 @@ $(document).ready(function() {
144144 debug : true ,
145145 } ) ;
146146 search . autocomplete . on ( 'autocomplete:updated' , event => {
147- $ ( '.ds-dropdown-menu .ds-suggestion' ) . each ( function ( ) {
148- let category = $ ( this ) . find ( '.algolia-docsearch-suggestion--subcategory-column' ) ;
149- let content = $ ( this ) . find ( '.algolia-docsearch-suggestion--title' ) ;
150- //if (content.text().trim() == category.text().trim()) {
151- // content.remove();
152- //}
147+ const searchedText = $ ( '.ais-SearchBox-input' ) [ 0 ] . value . trim ( ) ;
148+ $ ( '.algolia-docsearch-suggestion--wrapper' ) . each ( ( index , element ) => {
149+ const title = $ ( element ) . find ( '.algolia-docsearch-suggestion--title' ) ;
150+ const category = $ ( element ) . find ( '.algolia-docsearch-suggestion--subcategory-column-text' ) ;
151+ category . append ( '<span class="aa-suggestion-title-separator" aria-hidden="true">></span>' ) ;
152+ if ( title . find ( '.aa-suggestion-title-separator' ) . length ) {
153+ $ . each ( title . contents ( ) , ( i , e ) => {
154+ if ( title . contents ( ) . length > 1 ) {
155+ $ ( e ) . appendTo ( category ) ;
156+ }
157+ } ) ;
158+ }
159+ const displayedText = $ ( element ) . find ( '.algolia-docsearch-suggestion--text' ) ;
160+ if ( displayedText . length && displayedText . text ( ) == searchedText + '…' ) {
161+ displayedText . remove ( ) ;
162+ }
153163 } ) ;
154164 } ) ;
155165
You can’t perform that action at this time.
0 commit comments