|
|
|
|
@ -116,15 +116,19 @@ class NoteDetailText {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getContent() {
|
|
|
|
|
let content = this.textEditor.getData();
|
|
|
|
|
const content = this.textEditor.getData();
|
|
|
|
|
|
|
|
|
|
// if content is only tags/whitespace (typically <p> </p>), then just make it empty
|
|
|
|
|
// this is important when setting new note to code
|
|
|
|
|
if (jQuery(content).text().trim() === '' && !content.includes("<img")) {
|
|
|
|
|
content = '';
|
|
|
|
|
}
|
|
|
|
|
return this.isContentEmpty(content) ? '' : content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isContentEmpty(content) {
|
|
|
|
|
content = content.toLowerCase();
|
|
|
|
|
|
|
|
|
|
return content;
|
|
|
|
|
return jQuery(content).text().trim() === ''
|
|
|
|
|
&& !content.includes("<img")
|
|
|
|
|
&& !content.includes("<section")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async isReadOnly() {
|
|
|
|
|
|