Updated Custom widget (markdown)

zadam 2022-01-11 19:59:52 +01:00
parent 6d8b40a3ea
commit cd702b435b

@ -27,15 +27,15 @@ const TPL = `<div style="padding: 10px; border-top: 1px solid var(--main-border-
<span class="character-count"></span> <span class="character-count"></span>
</div`; </div`;
class WordCountWidget extends api.TabAwareWidget { class WordCountWidget extends api.NoteContextAwareWidget {
get position() { return 100; } // higher value means position towards the bottom/right get position() { return 100; } // higher value means position towards the bottom/right
get parentWidget() { return 'center-pane'; } get parentWidget() { return 'center-pane'; }
isEnabled() { isEnabled() {
return super.isEnabled() return super.isEnabled()
&& note.type === 'text' && this.note.type === 'text'
&& note.hasLabel('wordCount'); && this.note.hasLabel('wordCount');
} }
doRender() { doRender() {