@@ -9,13 +9,13 @@ namespace Elastic.Markdown.Helpers;
99
1010public static class Htmx
1111{
12- public static string GetHxSelectOob ( ConfigurationFile configuration , string ? pathPrefix , string currentUrl , string targetUrl )
12+ public static string GetHxSelectOob ( FeatureFlags features , string ? pathPrefix , string currentUrl , string targetUrl )
1313 {
1414 HashSet < string > selectTargets =
1515 [
1616 "#primary-nav" , "#secondary-nav" , "#markdown-content" , "#toc-nav" , "#prev-next-nav" , "#breadcrumbs"
1717 ] ;
18- if ( ! HasSameTopLevelGroup ( pathPrefix , currentUrl , targetUrl ) && configuration . Features . ContainsKey ( "primary-nav" ) )
18+ if ( ! HasSameTopLevelGroup ( pathPrefix , currentUrl , targetUrl ) && features . IsPrimaryNavEnabled )
1919 _ = selectTargets . Add ( "#pages-nav" ) ;
2020 return string . Join ( ',' , selectTargets ) ;
2121 }
@@ -36,12 +36,12 @@ public static bool HasSameTopLevelGroup(string? pathPrefix, string currentUrl, s
3636
3737 private static string [ ] GetSegments ( string url ) => url . Split ( '/' ) ;
3838
39- public static string GetHxAttributes ( ConfigurationFile configuration , string ? pathPrefix , string currentUrl , string targetUrl )
39+ public static string GetHxAttributes ( FeatureFlags features , string ? pathPrefix , string currentUrl , string targetUrl )
4040 {
4141
4242 var attributes = new StringBuilder ( ) ;
4343 _ = attributes . Append ( $ " hx-get={ targetUrl } ") ;
44- _ = attributes . Append ( $ " hx-select-oob={ GetHxSelectOob ( configuration , pathPrefix , currentUrl , targetUrl ) } ") ;
44+ _ = attributes . Append ( $ " hx-select-oob={ GetHxSelectOob ( features , pathPrefix , currentUrl , targetUrl ) } ") ;
4545 _ = attributes . Append ( $ " hx-swap={ GetHxSwap ( ) } ") ;
4646 _ = attributes . Append ( $ " hx-push-url={ GetHxPushUrl ( ) } ") ;
4747 _ = attributes . Append ( $ " hx-indicator={ GetHxIndicator ( ) } ") ;
0 commit comments