Merge pull request #526 from Arthur-Milchior/field_with_space_are_empty

strip to test whether field is empty
This commit is contained in:
Damien Elmes 2020-03-25 09:36:08 +10:00 committed by GitHub
commit 1ef984cc2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -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

View file

@ -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>`;
} }