-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't do a full page load when searching code #29138
Conversation
$(document).on('click', '.fold-container .fold-button', ({currentTarget}) => { | ||
invertFileFolding(currentTarget.closest('.fold-container'), currentTarget); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a <details>
element for the toggle mechanism instead of this JS? I know it can be (ab)used for a lot of use cases, so I think it's suitable.
@@ -42,8 +43,15 @@ func Code(ctx *context.Context) { | |||
ctx.Data["queryType"] = queryType | |||
ctx.Data["PageIsViewCode"] = true | |||
|
|||
isHtmxRequest := len(ctx.Req.Header.Values("HX-Request")) > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isHtmxRequest := len(ctx.Req.Header.Values("HX-Request")) > 0 | |
isHtmxRequest := ctx.Req.Header.Get("HX-Request") == "true" |
Using htmx without careful design would cause some "init" problems (see #29385 (comment) and #33854 ) About this PR: it is stale for long time, I then the benefit it brings is less than the maintainability cost. Feel free to reopen if there would be a better approach. |
Don't do a full page load when searching code and fold the result