mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Add focus class which mimics built-in focus
This commit is contained in:
parent
9018140eef
commit
a08d83deda
3 changed files with 13 additions and 5 deletions
|
@ -575,7 +575,7 @@ time = %(time)d;
|
||||||
def _showAnswerButton(self) -> None:
|
def _showAnswerButton(self) -> None:
|
||||||
middle = """
|
middle = """
|
||||||
<span class=stattxt>%s</span><br>
|
<span class=stattxt>%s</span><br>
|
||||||
<button title="%s" id=ansbut onclick='pycmd("ans");'>%s</button>""" % (
|
<button title="%s" id="ansbut" class="focus" onclick='pycmd("ans");'>%s</button>""" % (
|
||||||
self._remaining(),
|
self._remaining(),
|
||||||
_("Shortcut key: %s") % _("Space"),
|
_("Shortcut key: %s") % _("Space"),
|
||||||
_("Show Answer"),
|
_("Show Answer"),
|
||||||
|
@ -644,7 +644,7 @@ time = %(time)d;
|
||||||
|
|
||||||
def but(i, label):
|
def but(i, label):
|
||||||
if i == default:
|
if i == default:
|
||||||
extra = "id=defease"
|
extra = """id="defease" class="focus" """
|
||||||
else:
|
else:
|
||||||
extra = ""
|
extra = ""
|
||||||
due = self._buttonTime(i)
|
due = self._buttonTime(i)
|
||||||
|
|
|
@ -33,7 +33,17 @@ button {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ansbut { margin-bottom: 1em; }
|
#ansbut {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.focus {
|
||||||
|
outline: 5px auto rgba(0, 103, 244, 0.247);
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline-color: rgba(92, 160, 255, 0.247);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.nobold {
|
.nobold {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
|
@ -36,14 +36,12 @@ let updateTime = function () {
|
||||||
function showQuestion(txt, maxTime_) {
|
function showQuestion(txt, maxTime_) {
|
||||||
// much faster than jquery's .html()
|
// much faster than jquery's .html()
|
||||||
$("#middle")[0].innerHTML = txt;
|
$("#middle")[0].innerHTML = txt;
|
||||||
$("#ansbut").focus();
|
|
||||||
time = 0;
|
time = 0;
|
||||||
maxTime = maxTime_;
|
maxTime = maxTime_;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showAnswer(txt) {
|
function showAnswer(txt) {
|
||||||
$("#middle")[0].innerHTML = txt;
|
$("#middle")[0].innerHTML = txt;
|
||||||
$("#defease").focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectedAnswerButton() {
|
function selectedAnswerButton() {
|
||||||
|
|
Loading…
Reference in a new issue