Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
socket-example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Phillip Harris
socket-example
Commits
1b9d178d
Commit
1b9d178d
authored
6 months ago
by
Phil Harris
Browse files
Options
Downloads
Patches
Plain Diff
fix: update sidebar dropdown data binding for improved functionality
parent
2cc27cdd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/layouts/layout.templ
+1
-1
1 addition, 1 deletion
web/layouts/layout.templ
web/layouts/layout_templ.go
+1
-1
1 addition, 1 deletion
web/layouts/layout_templ.go
with
2 additions
and
2 deletions
web/layouts/layout.templ
+
1
−
1
View file @
1b9d178d
...
...
@@ -26,7 +26,7 @@ templ Main() {
</header>
<main
id=
"sidebar-main"
>
<a
href=
"/"
class=
"sidebar-link"
>
Home
</a>
// simple link
<div
class=
"sidebar-dropdown"
x-data=
"{open: $persist(false).using(sessionStorage).as($id)}"
id=
"sidebar-services"
>
<div
id=
"sidebar-services"
class=
"sidebar-dropdown"
x-data=
"{open: $persist(false).using(sessionStorage).as($
el.
id)}"
>
// example of a dropdown menu
<h2
class=
"list-none cursor-pointer"
@
click=
"open = !open"
>
Services
...
...
This diff is collapsed.
Click to expand it.
web/layouts/layout_templ.go
+
1
−
1
View file @
1b9d178d
...
...
@@ -100,7 +100,7 @@ func Main() templ.Component {
if
templ_7745c5c3_Err
!=
nil
{
return
templ_7745c5c3_Err
}
templ_7745c5c3_Err
=
templruntime
.
WriteString
(
templ_7745c5c3_Buffer
,
6
,
"
\"
></script></head><body class=
\"
grid grid-cols-[14rem_1fr]
\"
><aside id=
\"
sidebar
\"
><header id=
\"
sidebar-header
\"
><h1><a href=
\"
/
\"
>Socket</a></h1></header><main id=
\"
sidebar-main
\"
><a href=
\"
/
\"
class=
\"
sidebar-link
\"
>Home</a><div class=
\"
sidebar-dropdown
\"
x-data=
\"
{open: $persist(false).using(sessionStorage).as($id)}
\"
id=
\"
sidebar-services
\"
><h2 class=
\"
list-none cursor-pointer
\"
@click=
\"
open = !open
\"
>Services <span x-text=
\"
open ? '▲' : '▼'
\"
class=
\"
float-right
\"
></span></h2><div x-show=
\"
open
\"
x-collapse.duration.300ms x-cloak><a href=
\"
/services/1
\"
class=
\"
sidebar-link
\"
>Service 1</a> <a href=
\"
/services/2
\"
class=
\"
sidebar-link
\"
>Service 2</a></div></div><a href=
\"
/about
\"
class=
\"
sidebar-link
\"
>About</a> <a href=
\"
/contact
\"
class=
\"
sidebar-link
\"
>Contact</a></main><footer id=
\"
sidebar-footer
\"
><div id=
\"
footer-actions
\"
><a href=
\"
/logout
\"
class=
\"
sidebar-link
\"
>Logout</a></div><div id=
\"
sidebar-copyright
\"
>© "
)
templ_7745c5c3_Err
=
templruntime
.
WriteString
(
templ_7745c5c3_Buffer
,
6
,
"
\"
></script></head><body class=
\"
grid grid-cols-[14rem_1fr]
\"
><aside id=
\"
sidebar
\"
><header id=
\"
sidebar-header
\"
><h1><a href=
\"
/
\"
>Socket</a></h1></header><main id=
\"
sidebar-main
\"
><a href=
\"
/
\"
class=
\"
sidebar-link
\"
>Home</a><div
id=
\"
sidebar-services
\"
class=
\"
sidebar-dropdown
\"
x-data=
\"
{open: $persist(false).using(sessionStorage).as($
el.
id)}
\"
><h2 class=
\"
list-none cursor-pointer
\"
@click=
\"
open = !open
\"
>Services <span x-text=
\"
open ? '▲' : '▼'
\"
class=
\"
float-right
\"
></span></h2><div x-show=
\"
open
\"
x-collapse.duration.300ms x-cloak><a href=
\"
/services/1
\"
class=
\"
sidebar-link
\"
>Service 1</a> <a href=
\"
/services/2
\"
class=
\"
sidebar-link
\"
>Service 2</a></div></div><a href=
\"
/about
\"
class=
\"
sidebar-link
\"
>About</a> <a href=
\"
/contact
\"
class=
\"
sidebar-link
\"
>Contact</a></main><footer id=
\"
sidebar-footer
\"
><div id=
\"
footer-actions
\"
><a href=
\"
/logout
\"
class=
\"
sidebar-link
\"
>Logout</a></div><div id=
\"
sidebar-copyright
\"
>© "
)
if
templ_7745c5c3_Err
!=
nil
{
return
templ_7745c5c3_Err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment