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
m = self.note.model()
for c, f in enumerate(self.note.fields):
f = f.replace("<br>", "").strip()
notChangedvalues = {"", "<br>"}
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:
return False
return True

View File

@ -352,9 +352,7 @@ function setFields(fields) {
oncut='onCutOrCopy(this);'
contentEditable=true
class=field
>
${f}
</div>
>${f}</div>
</td>
</tr>`;
}