File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
pgml-dashboard/src/components Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 22 < nav aria-label ="breadcrumb z-1 ">
33 < ol class ="breadcrumb ">
44 < li class ="breadcrumb-item body-regular-text <% if links.is_empty() {%>active<% } %> ">
5- < a class ="d-flex gap-2 align-items-center " href ="/deployments ">
5+ < a class ="d-flex gap-2 align-items-center " href ="/deployments/clear ">
66 < span class ="icon-owl "> </ span >
77 Home
88 </ a >
Original file line number Diff line number Diff line change @@ -20,9 +20,17 @@ export default class extends Controller {
2020 setLeftNavToLocation ( ) {
2121 this . removeAllActive ( ) ;
2222
23- let tag =
24- "a[href='" + window . location . pathname + window . location . search + "']" ;
25- let element = this . element . querySelector ( tag ) ;
23+ // When we fix our routing window.location.search will not be needed.
24+ // then we can just get element by querySelector
25+ let tag = window . location . pathname + window . location . search . split ( "&" ) [ 0 ] ;
26+
27+ let element ;
28+
29+ for ( let item in this . linkTargets ) {
30+ if ( this . linkTargets [ item ] . href . includes ( tag ) ) {
31+ element = this . linkTargets [ item ] ;
32+ }
33+ }
2634
2735 if ( element ) {
2836 element . classList . add ( "active" ) ;
You can’t perform that action at this time.
0 commit comments