bookmarking should be available for all note types

This commit is contained in:
zadam 2021-10-08 16:18:00 +02:00
parent fa40a5f496
commit eecba725b0
2 changed files with 9 additions and 5 deletions

View File

@ -5,9 +5,9 @@ const DROPDOWN_TPL = `
<div class="bookmark-folder-widget">
<style>
.bookmark-folder-widget {
min-width: 200px;
min-width: 400px;
max-height: 500px;
padding: 10px 20px 10px 20px;
padding: 7px 15px 0 15px;
font-size: 110%;
overflow: auto;
}
@ -54,8 +54,6 @@ export default class BookmarkFolderWidget extends RightDropdownButtonWidget {
this.$parentNote = this.$dropdownContent.find('.parent-note');
this.$childrenNotes = this.$dropdownContent.find('.children-notes');
// this.$dropdownContent.on("click", "a", () => this.hideDropdown());
}
async dropdownShown() {

View File

@ -64,7 +64,7 @@ export default class BasicPropertiesWidget extends NoteContextAwareWidget {
}
isEnabled() {
return this.note && (this.note.type === 'text' || this.note.type === 'code' || this.note.type === 'mermaid');
return this.note;
}
getTitle() {
@ -84,4 +84,10 @@ export default class BasicPropertiesWidget extends NoteContextAwareWidget {
this.$widget.find(".editability-select-container").append(this.editabilitySelectWidget.render());
this.$widget.find(".bookmark-switch-container").append(this.bookmarkSwitchWidget.render());
}
async refreshWithNote(note) {
await super.refreshWithNote(note);
this.$widget.find(".editability-select-container").toggle(this.note && ['text', 'code'].includes(this.note.type))
}
}