File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
src/CognitiveSearch.UI/CognitiveSearch.UI Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class ClientAction
1212 public string svgicon { get ; set ; }
1313 public string method { get ; set ; }
1414 public string filter { get ; set ; }
15+ public string classList { get ; set ; }
1516 public bool isDefault { get ; set ; }
1617 }
1718}
Original file line number Diff line number Diff line change 104104 "title" : " Only search Emails" ,
105105 "fonticon" : " bi bi-envelope" ,
106106 "method" : " Microsoft.All.UpdateResultsAsList" ,
107- "filter" : " (content_group eq 'Email')"
107+ "filter" : " (content_group eq 'Email')" ,
108+ "classList" : " btn-outline-primary"
108109 },
109110 {
110111 "name" : " attachments" ,
111112 "title" : " Only search Emails' attachments" ,
112113 "fonticon" : " bi bi-paperclip" ,
113114 "method" : " Microsoft.All.UpdateResultsAsList" ,
114- "filter" : " (document_embedded eq true and parent/content_group eq 'Email')"
115+ "filter" : " (document_embedded eq true and parent/content_group eq 'Email')" ,
116+ "classList" : " btn-outline-primary"
115117 }
116118 ]
117119 },
Original file line number Diff line number Diff line change @@ -807,16 +807,25 @@ Microsoft.Search.Results = {
807807 if ( Microsoft . View . config . resultsRenderings && Microsoft . View . config . resultsRenderings . length > 0 ) {
808808 var renderingHtml = '' ;
809809
810- var switchClassList = "view-switch-button btn btn-outline-secondary btn- sm" ;
811- var switchClassListActive = "view-switch-button btn btn-outline-secondary btn- sm active" ;
810+ var switchClassList = "view-switch-button btn btn-sm" ;
811+ var switchClassListActive = "view-switch-button btn btn-sm active" ;
812812
813813 // For each rendering of the search vertical
814814 for ( var i = 0 ; i < Microsoft . View . config . resultsRenderings . length ; i ++ ) {
815815 var rendering = Microsoft . View . config . resultsRenderings [ i ] ;
816816
817817 if ( rendering . name !== "blank" )
818818 {
819- renderingHtml += ' <label id="switch-' + rendering . name + '" title="' + rendering . title + '" class="' + ( Microsoft . Search . results_rendering === i ? switchClassListActive : switchClassList ) + '" onclick="Microsoft.Search.Results.switchResultsView(' + i + ');">' ;
819+ var finalClass = ( Microsoft . Search . results_rendering === i ? switchClassListActive : switchClassList ) ;
820+ if ( rendering . classList )
821+ {
822+ finalClass += ' ' + rendering . classList ;
823+ }
824+ else
825+ {
826+ finalClass += ' btn-outline-secondary' ;
827+ }
828+ renderingHtml += ' <label id="switch-' + rendering . name + '" title="' + rendering . title + '" class="' + finalClass + '" onclick="Microsoft.Search.Results.switchResultsView(' + i + ');">' ;
820829 renderingHtml += ' <span class="' + rendering . fonticon + '"/>' ;
821830 renderingHtml += ' </label>' ;
822831 }
You can’t perform that action at this time.
0 commit comments