mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	added total result count to the note list widget
This commit is contained in:
		
							parent
							
								
									86d62866f2
								
							
						
					
					
						commit
						78f8a37587
					
				@ -252,11 +252,15 @@ class NoteListRenderer {
 | 
			
		||||
            if (pageCount < 20 || i <= 5 || pageCount - i <= 5 || Math.abs(this.page - i) <= 2) {
 | 
			
		||||
                lastPrinted = true;
 | 
			
		||||
 | 
			
		||||
                const startIndex = (i - 1) * this.pageSize + 1;
 | 
			
		||||
                const endIndex = Math.min(this.noteIds.length, i * this.pageSize);
 | 
			
		||||
 | 
			
		||||
                $pager.append(
 | 
			
		||||
                    i === this.page
 | 
			
		||||
                        ? $('<span>').text(i).css('text-decoration', 'underline').css('font-weight', "bold")
 | 
			
		||||
                        : $('<a href="javascript:">')
 | 
			
		||||
                            .text(i)
 | 
			
		||||
                            .attr("title", `Page of ${startIndex} - ${endIndex}`)
 | 
			
		||||
                            .on('click', () => {
 | 
			
		||||
                                this.page = i;
 | 
			
		||||
                                this.renderList();
 | 
			
		||||
@ -270,6 +274,9 @@ class NoteListRenderer {
 | 
			
		||||
                lastPrinted = false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // no need to distinguish "note" vs "notes" since in case of one result, there's no paging at all
 | 
			
		||||
        $pager.append(`<span class="note-list-pager-total-count">(${this.noteIds.length} notes)</span>`);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async renderNote(note, expand = false) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user