Restrict onclick to h1 text
This change modifies the onclick event to apply only to the h1 text within the header section of the blog index page. Previously, the onclick event was applied to the entire header section, which could lead to unintended behavior when users interacted with other parts of the header. By restricting the onclick event to just the h1 text, we ensure that only the intended element responds to user clicks, improving the user experience and preventing potential confusion.
This commit is contained in:
parent
890ee95d28
commit
2d7d750d91
1 changed files with 2 additions and 2 deletions
|
|
@ -10,9 +10,9 @@
|
|||
{% block content %}
|
||||
{% for post in posts %}
|
||||
<article class="post">
|
||||
<header class="post-header" onclick="togglePostBody({{ post['id'] }})">
|
||||
<header class="post-header">
|
||||
<div>
|
||||
<h1>{{ post['title'] }}</h1>
|
||||
<h1 onclick="togglePostBody({{ post['id'] }})">{{ post['title'] }}</h1>
|
||||
<div class="about">by {{ post['username'] }} on {{ post['created'].strftime('%Y-%m-%d') }}</div>
|
||||
</div>
|
||||
{% if g.user['id'] == post['author_id'] %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue