Skip to content
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

JavaScript to highlight timeline item is not working #22

Open
jnns opened this issue Apr 19, 2022 · 0 comments
Open

JavaScript to highlight timeline item is not working #22

jnns opened this issue Apr 19, 2022 · 0 comments

Comments

@jnns
Copy link

jnns commented Apr 19, 2022

I noticed that, when opening the panel, a request is made to /<page>/static/js/template_profiler.js and it returns with a 404.

Using the static helper from contrib.staticfiles makes the panel find the javascript file:

from django.templatetags.static import static

class TemplateProfilerPanel(Panel):
    @property
    def scripts(self):
        return [static("js/template_profiler.js")]

But now another problem arises: jQuery is not guaranteed to be available.

We could get around using JavaScript and jQuery altogether by adding a small CSS snippet to the panel's template:

<style>
  .timeline_item:hover {
    border: red 0.1px solid !important;
  }
</style>

Please let me know what you think about this approach. I can submit a pull request if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant