Skip to content

Commit a44f2a0

Browse files
committed
fix: re-add ability to hide / show All link in PL navigation
1 parent 41232e7 commit a44f2a0

File tree

1 file changed

+17
-10
lines changed
  • packages/uikit-workshop/src/scripts/components/pl-nav

1 file changed

+17
-10
lines changed

packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,16 +534,23 @@ class Nav extends BaseComponent {
534534
);
535535
})}
536536

537-
{/* <li class="pl-c-nav__item">
538-
<a
539-
href="styleguide/html/styleguide.html"
540-
class="pl-c-nav__link pl-c-nav__link--pattern"
541-
data-patternpartial="all"
542-
tabindex="0"
543-
>
544-
All
545-
</a>
546-
</li> */}
537+
{/* display the All link if window.ishControlsHide is undefined (for some reason) OR window.ishControls.ishControlsHide doesn't have `views-all` and/or `all` set to true */}
538+
539+
{(window.ishControls === undefined ||
540+
window.ishControls.ishControlsHide === undefined ||
541+
(window.ishControls.ishControlsHide['views-all'] !== true &&
542+
window.ishControls.ishControlsHide['all'] !== true)) && (
543+
<li class="pl-c-nav__item">
544+
<a
545+
onClick={e => this.handleClick(e, 'all')}
546+
href="styleguide/html/styleguide.html"
547+
class="pl-c-nav__link pl-c-nav__link--pattern"
548+
data-patternpartial="all"
549+
tabindex="0">
550+
All
551+
</a>
552+
</li>
553+
)}
547554
</ol>
548555
);
549556
}

0 commit comments

Comments
 (0)