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) {
 | 
					            if (pageCount < 20 || i <= 5 || pageCount - i <= 5 || Math.abs(this.page - i) <= 2) {
 | 
				
			||||||
                lastPrinted = true;
 | 
					                lastPrinted = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                const startIndex = (i - 1) * this.pageSize + 1;
 | 
				
			||||||
 | 
					                const endIndex = Math.min(this.noteIds.length, i * this.pageSize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $pager.append(
 | 
					                $pager.append(
 | 
				
			||||||
                    i === this.page
 | 
					                    i === this.page
 | 
				
			||||||
                        ? $('<span>').text(i).css('text-decoration', 'underline').css('font-weight', "bold")
 | 
					                        ? $('<span>').text(i).css('text-decoration', 'underline').css('font-weight', "bold")
 | 
				
			||||||
                        : $('<a href="javascript:">')
 | 
					                        : $('<a href="javascript:">')
 | 
				
			||||||
                            .text(i)
 | 
					                            .text(i)
 | 
				
			||||||
 | 
					                            .attr("title", `Page of ${startIndex} - ${endIndex}`)
 | 
				
			||||||
                            .on('click', () => {
 | 
					                            .on('click', () => {
 | 
				
			||||||
                                this.page = i;
 | 
					                                this.page = i;
 | 
				
			||||||
                                this.renderList();
 | 
					                                this.renderList();
 | 
				
			||||||
@ -270,6 +274,9 @@ class NoteListRenderer {
 | 
				
			|||||||
                lastPrinted = false;
 | 
					                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) {
 | 
					    async renderNote(note, expand = false) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user