fix autobook switching back to text

This commit is contained in:
zadam 2020-03-15 21:31:25 +01:00
parent 6de0f75931
commit 6a1bfdeab9
3 changed files with 11 additions and 3 deletions

View File

@ -240,8 +240,10 @@ export default class NoteDetailWidget extends TabAwareWidget {
this.spacedUpdate.updateNowIfNecessary();
}
autoBookDisabledEvent() {
this.refresh();
autoBookDisabledEvent({tabContext}) {
if (this.isTab(tabContext.tabId)) {
this.refresh();
}
}
async cutIntoNoteCommand() {

View File

@ -136,7 +136,7 @@ export default class BookTypeWidget extends TypeWidget {
const $addTextLink = $('<a href="javascript:">here</a>').on('click', () => {
this.tabContext.autoBookDisabled = true;
this.triggerEvent('autoBookDisabled');
this.triggerEvent('autoBookDisabled', {tabContext: this.tabContext});
});
this.$content.append($('<div class="note-book-auto-message"></div>')

View File

@ -36,4 +36,10 @@ export default class TypeWidget extends TabAwareWidget {
scrollToTop() {
this.$widget.scrollTop(0);
}
autoBookDisabledEvent({tabContext}) {
if (this.isTab(tabContext.tabId)) {
this.refresh();
}
}
}