mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-18 14:16:45 +00:00
Refines preventDefault logic
This commit is contained in:
parent
2f93017eaa
commit
3026a86b11
2 changed files with 3 additions and 3 deletions
|
@ -138,10 +138,10 @@ let BookWyrm = new class {
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
toggleAction(event) {
|
toggleAction(event) {
|
||||||
if (event.currentTarget == event.target) {
|
let trigger = event.currentTarget;
|
||||||
|
if (!trigger.dataset.allowDefault || event.currentTarget == event.target) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
let trigger = event.currentTarget;
|
|
||||||
let pressed = trigger.getAttribute('aria-pressed') === 'false';
|
let pressed = trigger.getAttribute('aria-pressed') === 'false';
|
||||||
let targetId = trigger.dataset.controls;
|
let targetId = trigger.dataset.controls;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
{% with 0|uuid as local_uuid %}
|
{% with 0|uuid as local_uuid %}
|
||||||
<div class="is-flex is-justify-content-space-between">
|
<div class="is-flex is-justify-content-space-between">
|
||||||
<label for="post_status_{{ local_uuid }}_{{ uuid }}" data-controls="reading_content_{{ local_uuid }}_{{ uuid }}" data-controls-checkbox="post_status_{{ local_uuid }}_{{ uuid }}" data-disables="reading_content_fieldset_{{ local_uuid }}_{{ uuid }}" aria-pressed="true">
|
<label for="post_status_{{ local_uuid }}_{{ uuid }}" data-controls="reading_content_{{ local_uuid }}_{{ uuid }}" data-controls-checkbox="post_status_{{ local_uuid }}_{{ uuid }}" data-disables="reading_content_fieldset_{{ local_uuid }}_{{ uuid }}" aria-pressed="true" data-allow-default="true">
|
||||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status_{{ local_uuid }}_{{ uuid }}" checked>
|
<input type="checkbox" name="post-status" class="checkbox" id="post_status_{{ local_uuid }}_{{ uuid }}" checked>
|
||||||
{% trans "Post to feed" %}
|
{% trans "Post to feed" %}
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in a new issue