Skip to content

Commit 0e6de17

Browse files
jakebaileygopherbot
authored andcommitted
static/frontend: hide subpackage expansion button when all internal
If all of a package's subpackages are internal, the button will do nothing when clicked unless "show internal" has been clicked. Prevent the expand button from appearing when this is the case by applying the same CSS class used to hide the internal packages themselves. Fixes golang/go#70313 Change-Id: Ie66b90ba4bb2a1e8d1a90ac3710422bfadb610b1 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/673717 Auto-Submit: Robert Findley <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> kokoro-CI: kokoro <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 4065921 commit 0e6de17

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

static/frontend/unit/main/_directories.tmpl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@
4444
<div class="UnitDirectories-pathCell">
4545
<div>
4646
{{- if .Subdirectories -}}
47-
<button type="button" class="go-Button go-Button--inline UnitDirectories-toggleButton"
47+
{{- $allInternal := true -}}
48+
{{- range .Subdirectories -}}
49+
{{- if not .IsInternal -}}
50+
{{- $allInternal = false -}}
51+
{{- end -}}
52+
{{- end -}}
53+
<button type="button" class="go-Button go-Button--inline UnitDirectories-toggleButton{{if $allInternal}} UnitDirectories-internal{{end}}"
4854
aria-expanded="false"
4955
aria-label="{{len .Subdirectories}} more from"
5056
data-aria-controls="{{range .Subdirectories}}{{$prefix}}-{{.Suffix}} {{end}}"
Loading
Loading

0 commit comments

Comments
 (0)