Changes for page Solr Search
Last modified by Monika Leung on 2025/04/05 16:25
From version 1.1
edited by Sys Admin
on 2023/08/21 16:32
on 2023/08/21 16:32
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-search-solr-ui/15.6]
To version 2.1
edited by Monika Leung
on 2023/09/08 16:45
on 2023/09/08 16:45
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-search-solr-ui/15.7]
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. sysadmin1 +XWiki.leung
- XWiki.JavaScriptExtension[0]
-
- code
-
... ... @@ -37,14 +37,21 @@ 37 37 } 38 38 }; 39 39 40 - var addFacetValueCheckbox = function() { 41 - var checkBox = $(document.createElement('input')).attr('type', 'checkbox'); 40 + var addFacetValueCheckbox = function(index) { 41 + // Create an id unique to the facet value. 42 + let facetContainer = $(this).parents('.search-facet').first(); 43 + $(this).attr('id', facetContainer.attr('data-name') + '-' + index.toString()); 44 + // Initialize the checkbox. 45 + let checkBox = $(document.createElement('input')).attr('type', 'checkbox'); 46 + checkBox.attr('aria-labelledby', $(this).attr('id')); 42 42 checkBox.prop('checked', $(this).hasClass('selected')); 43 43 // Add the 'checked' attribute so that it can be easily located with CSS. 44 44 checkBox.prop('checked') && checkBox.attr('checked', 'checked'); 45 45 checkBox.on('click', this.click.bind(this)); 46 - // Remove the 'selected' class because the selected state is marked using the check box. 47 - $(this).removeClass('selected').before(checkBox); 51 + // Remove the 'selected' class because the selected state is already marked using the check box. 52 + $(this).removeClass('selected') 53 + // Add the checkbox to the DOM 54 + $(this).before(checkBox) 48 48 }; 49 49 50 50 var enhanceSearchFacets = function() {
- XWiki.StyleSheetExtension[0]
-
- code
-
... ... @@ -329,6 +329,8 @@ 329 329 } 330 330 331 331 .search-facet-body li { 332 + display: flex; 333 + flex-wrap: wrap; 332 332 padding: .1em .2em; 333 333 } 334 334 ... ... @@ -353,7 +353,6 @@ 353 353 } 354 354 355 355 .search-facet-body input[type="checkbox"] { 356 - float: left; 357 357 margin: .2em 0; 358 358 } 359 359 ... ... @@ -384,8 +384,8 @@ 384 384 } 385 385 386 386 .search-facet-body .itemCount { 387 - float: right; 388 388 padding: .1em 0; 389 + margin-left: auto; 389 389 } 390 390 391 391 @media (max-width: 768px) {