mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 03:46:37 +01:00 
			
		
		
		
	fix tab title of deleted note
This commit is contained in:
		@@ -24,7 +24,6 @@ import NoteRevisionsWidget from "../widgets/collapsible_widgets/note_revisions.j
 | 
			
		||||
import SimilarNotesWidget from "../widgets/collapsible_widgets/similar_notes.js";
 | 
			
		||||
import WhatLinksHereWidget from "../widgets/collapsible_widgets/what_links_here.js";
 | 
			
		||||
import SidePaneToggles from "../widgets/side_pane_toggles.js";
 | 
			
		||||
import appContext from "../services/app_context.js";
 | 
			
		||||
 | 
			
		||||
const RIGHT_PANE_CSS = `
 | 
			
		||||
<style>
 | 
			
		||||
@@ -117,6 +116,7 @@ export default class DesktopMainWindowLayout {
 | 
			
		||||
                .hideInZenMode())
 | 
			
		||||
            .child(new FlexContainer('row')
 | 
			
		||||
                .collapsible()
 | 
			
		||||
                .filling()
 | 
			
		||||
                .child(new SidePaneContainer('left')
 | 
			
		||||
                    .hideInZenMode()
 | 
			
		||||
                    .child(new GlobalButtonsWidget())
 | 
			
		||||
 
 | 
			
		||||
@@ -30,6 +30,11 @@ class BasicWidget extends Component {
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    filling() {
 | 
			
		||||
        this.css('flex-grow', '1');
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    hideInZenMode() {
 | 
			
		||||
        this.class('hide-in-zen-mode');
 | 
			
		||||
        return this;
 | 
			
		||||
 
 | 
			
		||||
@@ -602,18 +602,22 @@ export default class TabRowWidget extends BasicWidget {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    updateTab($tab, note) {
 | 
			
		||||
        if (!note || !$tab.length) {
 | 
			
		||||
        if (!$tab.length) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.updateTitle($tab, note.title);
 | 
			
		||||
 | 
			
		||||
        for (const clazz of Array.from($tab[0].classList)) { // create copy to safely iterate over while removing classes
 | 
			
		||||
            if (clazz !== 'note-tab') {
 | 
			
		||||
                $tab.removeClass(clazz);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!note) {
 | 
			
		||||
            this.updateTitle($tab, 'New tab');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.updateTitle($tab, note.title);
 | 
			
		||||
 | 
			
		||||
        $tab.addClass(note.getCssClass());
 | 
			
		||||
        $tab.addClass(utils.getNoteTypeClass(note.type));
 | 
			
		||||
        $tab.addClass(utils.getMimeTypeClass(note.mime));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user