forked from mirrors/bookwyrm
Don't do fancy javascript clicks on the notification page
This commit is contained in:
parent
d60684e08e
commit
8d72169bbd
3 changed files with 7 additions and 28 deletions
|
@ -1,21 +0,0 @@
|
|||
/* exported BlockHref */
|
||||
|
||||
let BlockHref = new (class {
|
||||
constructor() {
|
||||
document
|
||||
.querySelectorAll("[data-href]")
|
||||
.forEach((t) => t.addEventListener("click", this.followLink.bind(this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Follow a fake link
|
||||
*
|
||||
* @param {Event} event
|
||||
* @return {undefined}
|
||||
*/
|
||||
followLink(event) {
|
||||
const url = event.currentTarget.dataset.href;
|
||||
|
||||
window.location.href = url;
|
||||
}
|
||||
})();
|
|
@ -1,12 +1,15 @@
|
|||
{% load bookwyrm_tags %}
|
||||
{% related_status notification as related_status %}
|
||||
<div class="notification is-clickable {% if notification.id in unread %} is-primary{% endif %}" data-href="{% block primary_link %}{% endblock %}">
|
||||
<div class="box is-shadowless has-background-white-ter {% if notification.id in unread %} is-primary{% endif %}">
|
||||
<div class="columns is-mobile">
|
||||
<div class="column is-narrow is-size-3 {% if notification.id in unread%}has-text-white{% else %}has-text-grey{% endif %}">
|
||||
<a class="has-text-dark" href="{% block primary_link %}{% endblock %}">
|
||||
{% block icon %}{% endblock %}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="column is-clipped">
|
||||
<div class="block">
|
||||
<div class="block content">
|
||||
<p>
|
||||
{% if notification.related_user %}
|
||||
<a href="{{ notification.related_user.local_path }}">{% include 'snippets/avatar.html' with user=notification.related_user %}
|
||||
|
@ -15,6 +18,7 @@
|
|||
{% block description %}{% endblock %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% if related_status %}
|
||||
<div class="block">
|
||||
{% block preview %}{% endblock %}
|
||||
|
|
|
@ -46,7 +46,3 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{% static "js/block_href.js" %}?v={{ js_cache }}"></script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue