File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/main/content/_assets/js Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1046,9 +1046,15 @@ $(document).ready(function () {
10461046 showAllCategories ( ) ;
10471047 } ) ;
10481048
1049- // Click buttons to fill search bar
1049+ // Click buttons to fill search bar
10501050 $ ( "#guides_search_container" ) . on ( "click focus" , ".tag_button" , function ( ) {
1051- var inputValue = "tag: " + $ ( this ) . html ( ) ;
1051+ var clickedTag = $ ( this ) . html ( ) ;
1052+ var inputValue = $ ( "#guide_search_input" ) . val ( ) ;
1053+ if ( inputValue === "" ) {
1054+ inputValue = "tag: " + clickedTag ;
1055+ } else if ( ! inputValue . includes ( clickedTag ) ) {
1056+ inputValue += " " + clickedTag ;
1057+ }
10521058 $ ( "#guide_search_input" ) . val ( inputValue ) ;
10531059 $ ( ".tag_button" ) . removeClass ( "hidden" ) ;
10541060 $ ( this ) . addClass ( "hidden" ) ;
You can’t perform that action at this time.
0 commit comments