mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	added "re-render note" menu item & shortcut, closes #1766
This commit is contained in:
		@@ -63,6 +63,7 @@ const TPL = `
 | 
			
		||||
        <span class="caret"></span>
 | 
			
		||||
    </button>
 | 
			
		||||
    <div class="dropdown-menu dropdown-menu-right">
 | 
			
		||||
        <a data-trigger-command="renderActiveNote" class="dropdown-item render-note-button">Re-render note</a>
 | 
			
		||||
        <div class="dropdown-item protect-button">
 | 
			
		||||
            Protect the note
 | 
			
		||||
        
 | 
			
		||||
@@ -96,6 +97,7 @@ export default class NoteActionsWidget extends TabAwareWidget {
 | 
			
		||||
        this.overflowing();
 | 
			
		||||
 | 
			
		||||
        this.$showSourceButton = this.$widget.find('.show-source-button');
 | 
			
		||||
        this.$renderNoteButton = this.$widget.find('.render-note-button');
 | 
			
		||||
 | 
			
		||||
        this.$exportNoteButton = this.$widget.find('.export-note-button');
 | 
			
		||||
        this.$exportNoteButton.on("click", () => {
 | 
			
		||||
@@ -120,16 +122,22 @@ export default class NoteActionsWidget extends TabAwareWidget {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    refreshWithNote(note) {
 | 
			
		||||
        if (['text', 'relation-map', 'search', 'code'].includes(note.type)) {
 | 
			
		||||
            this.$showSourceButton.removeAttr('disabled');
 | 
			
		||||
        } else {
 | 
			
		||||
            this.$showSourceButton.attr('disabled', 'disabled');
 | 
			
		||||
        }
 | 
			
		||||
        this.toggleDisabled(this.$showSourceButton, ['text', 'relation-map', 'search', 'code'].includes(note.type));
 | 
			
		||||
 | 
			
		||||
        this.$renderNoteButton.toggle(note.type === 'render');
 | 
			
		||||
 | 
			
		||||
        this.$protectButton.toggle(!note.isProtected);
 | 
			
		||||
        this.$unprotectButton.toggle(!!note.isProtected);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    toggleDisabled($el, enable) {
 | 
			
		||||
        if (enable) {
 | 
			
		||||
            $el.removeAttr('disabled');
 | 
			
		||||
        } else {
 | 
			
		||||
            $el.attr('disabled', 'disabled');
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    entitiesReloadedEvent({loadResults}) {
 | 
			
		||||
        if (loadResults.isNoteReloaded(this.noteId)) {
 | 
			
		||||
            this.refresh();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user