mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Merge pull request #526 from Arthur-Milchior/field_with_space_are_empty
strip to test whether field is empty
This commit is contained in:
commit
1ef984cc2a
2 changed files with 3 additions and 4 deletions
|
@ -496,9 +496,10 @@ class Editor:
|
||||||
return True
|
return True
|
||||||
m = self.note.model()
|
m = self.note.model()
|
||||||
for c, f in enumerate(self.note.fields):
|
for c, f in enumerate(self.note.fields):
|
||||||
|
f = f.replace("<br>", "").strip()
|
||||||
notChangedvalues = {"", "<br>"}
|
notChangedvalues = {"", "<br>"}
|
||||||
if previousNote and m["flds"][c]["sticky"]:
|
if previousNote and m["flds"][c]["sticky"]:
|
||||||
notChangedvalues.add(previousNote.fields[c])
|
notChangedvalues.add(previousNote.fields[c].replace("<br>", "").strip())
|
||||||
if f not in notChangedvalues:
|
if f not in notChangedvalues:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -352,9 +352,7 @@ function setFields(fields) {
|
||||||
oncut='onCutOrCopy(this);'
|
oncut='onCutOrCopy(this);'
|
||||||
contentEditable=true
|
contentEditable=true
|
||||||
class=field
|
class=field
|
||||||
>
|
>${f}</div>
|
||||||
${f}
|
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue