소스 검색

Add show-more to facets

Jordi Boggiano 7 년 전
부모
커밋
cc5665c4c6
2개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 0
      src/Packagist/WebBundle/Resources/public/css/main.css
  2. 3 1
      src/Packagist/WebBundle/Resources/public/js/search.js

+ 10 - 0
src/Packagist/WebBundle/Resources/public/css/main.css

@@ -449,6 +449,16 @@ strong {
     font-weight: bold;
 }
 
+.search-facets .ais-show-more {
+    cursor: pointer;
+    margin-top: 10px;
+    display: inline-block;
+}
+.search-facets .ais-show-more:after {
+    content: '...';
+    display: inline-block;
+}
+
 .wrapper-footer {
     background: #2d2d32;
     font-size: 14px;

+ 3 - 1
src/Packagist/WebBundle/Resources/public/js/search.js

@@ -124,6 +124,7 @@ search.addWidget(
     container: '.search-facets-type',
     attributeName: 'type',
     limit: 15,
+    showMore: true,
     templates: {
       header: 'Package type'
     }
@@ -134,7 +135,8 @@ search.addWidget(
   instantsearch.widgets.menu({
     container: '.search-facets-tags',
     attributeName: 'tags',
-    limit: 20,
+    limit: 15,
+    showMore: true,
     templates: {
       header: 'Tags'
     }