mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
Revert "Remove <br> from empty fields."
This reverts commit 4ca2220117
.
The above commit caused a regression with RTL text:
https://anki.tenderapp.com/discussions/ankidesktop/33592-bugs-in-add-box
This commit is contained in:
parent
8c58e7a76a
commit
4a2f39e8f4
2 changed files with 9 additions and 3 deletions
|
@ -8,9 +8,7 @@
|
|||
padding: 5px;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
.field:empty:before {
|
||||
content: "\00a0"; /* nbsp */
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
content: "";
|
||||
display: table;
|
||||
|
|
|
@ -91,6 +91,11 @@ function inPreEnvironment() {
|
|||
}
|
||||
|
||||
function onInput() {
|
||||
// empty field?
|
||||
if (currentField.innerHTML === "") {
|
||||
currentField.innerHTML = "<br>";
|
||||
}
|
||||
|
||||
// make sure IME changes get saved
|
||||
triggerKeyTimer();
|
||||
}
|
||||
|
@ -293,6 +298,9 @@ function setFields(fields) {
|
|||
for (var i = 0; i < fields.length; i++) {
|
||||
var n = fields[i][0];
|
||||
var f = fields[i][1];
|
||||
if (!f) {
|
||||
f = "<br>";
|
||||
}
|
||||
txt += "<tr><td class=fname>{0}</td></tr><tr><td width=100%>".format(n);
|
||||
txt += "<div id=f{0} onkeydown='onKey();' oninput='onInput()' onmouseup='onKey();'".format(i);
|
||||
txt += " onfocus='onFocus(this);' onblur='onBlur();' class='field clearfix' ";
|
||||
|
|
Loading…
Reference in a new issue