mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Prevent accidental dragging of audio playback buttons and hint links (#3844)
* Add myself to CONTRIBUTORS * Set draggable="false" attribute on .replay-button Because currently if a user drags slightly (even unintentionally) upon clicking a play button, play does not happen * Prevent dragging hint links Because if a user moves cursor a little after `mousedown`, action (expanding the hint) does not occur. Which might cause issues from accessibility standpoint
This commit is contained in:
parent
f5f22edb6a
commit
339bf436d1
3 changed files with 4 additions and 3 deletions
|
@ -207,6 +207,7 @@ Luca Auer <lolle2000.la@gmail.com>
|
||||||
Niclas Heinz <nheinz@hpost.net>
|
Niclas Heinz <nheinz@hpost.net>
|
||||||
Omar Kohl <omarkohl@posteo.net>
|
Omar Kohl <omarkohl@posteo.net>
|
||||||
David Elizalde <david.elizalde.r.a@gmail.com>
|
David Elizalde <david.elizalde.r.a@gmail.com>
|
||||||
|
beyondcompute <beyondcompute@gmail.com>
|
||||||
Yuki <https://github.com/YukiNagat0>
|
Yuki <https://github.com/YukiNagat0>
|
||||||
wackbyte <wackbyte@protonmail.com>
|
wackbyte <wackbyte@protonmail.com>
|
||||||
GithubAnon0000 <GithubAnon0000@users.noreply.github.com>
|
GithubAnon0000 <GithubAnon0000@users.noreply.github.com>
|
||||||
|
|
|
@ -845,7 +845,7 @@ def av_refs_to_play_icons(text: str) -> str:
|
||||||
|
|
||||||
def repl(match: re.Match) -> str:
|
def repl(match: re.Match) -> str:
|
||||||
return f"""
|
return f"""
|
||||||
<a class="replay-button soundLink" href=# onclick="pycmd('{match.group(1)}'); return false;">
|
<a class="replay-button soundLink" href=# onclick="pycmd('{match.group(1)}'); return false;" draggable="false">
|
||||||
<svg class="playImage" viewBox="0 0 64 64" version="1.1">
|
<svg class="playImage" viewBox="0 0 64 64" version="1.1">
|
||||||
<circle cx="32" cy="32" r="29" />
|
<circle cx="32" cy="32" r="29" />
|
||||||
<path d="M56.502,32.301l-37.502,20.101l0.329,-40.804l37.173,20.703Z" />
|
<path d="M56.502,32.301l-37.502,20.101l0.329,-40.804l37.173,20.703Z" />
|
||||||
|
|
|
@ -192,7 +192,7 @@ fn hint_filter<'a>(text: &'a str, field_name: &str) -> Cow<'a, str> {
|
||||||
<a class=hint href="#"
|
<a class=hint href="#"
|
||||||
onclick="this.style.display='none';
|
onclick="this.style.display='none';
|
||||||
document.getElementById('hint{}').style.display='block';
|
document.getElementById('hint{}').style.display='block';
|
||||||
return false;">
|
return false;" draggable=false>
|
||||||
{}</a>
|
{}</a>
|
||||||
<div id="hint{}" class=hint style="display: none">{}</div>
|
<div id="hint{}" class=hint style="display: none">{}</div>
|
||||||
"##,
|
"##,
|
||||||
|
@ -232,7 +232,7 @@ mod test {
|
||||||
<a class=hint href="#"
|
<a class=hint href="#"
|
||||||
onclick="this.style.display='none';
|
onclick="this.style.display='none';
|
||||||
document.getElementById('hint83fe48607f0f3a66').style.display='block';
|
document.getElementById('hint83fe48607f0f3a66').style.display='block';
|
||||||
return false;">
|
return false;" draggable=false>
|
||||||
field</a>
|
field</a>
|
||||||
<div id="hint83fe48607f0f3a66" class=hint style="display: none">foo</div>
|
<div id="hint83fe48607f0f3a66" class=hint style="display: none">foo</div>
|
||||||
"##
|
"##
|
||||||
|
|
Loading…
Reference in a new issue