mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	fix toc with > 10 items on the same level, closes #3182
This commit is contained in:
		
							parent
							
								
									c2308b7a5d
								
							
						
					
					
						commit
						c6d4eb486e
					
				@ -23,7 +23,7 @@ const TPL = `<div class="toc-widget">
 | 
				
			|||||||
        .toc-widget {
 | 
					        .toc-widget {
 | 
				
			||||||
            padding: 10px;
 | 
					            padding: 10px;
 | 
				
			||||||
            contain: none; 
 | 
					            contain: none; 
 | 
				
			||||||
            overflow:auto;
 | 
					            overflow: auto;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        .toc ol {
 | 
					        .toc ol {
 | 
				
			||||||
@ -31,7 +31,15 @@ const TPL = `<div class="toc-widget">
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        .toc > ol {
 | 
					        .toc > ol {
 | 
				
			||||||
            padding-left: 10px;
 | 
					            padding-left: 20px;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        .toc li {
 | 
				
			||||||
 | 
					            cursor: pointer;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        .toc li:hover {
 | 
				
			||||||
 | 
					            font-weight: bold;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    </style>
 | 
					    </style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -154,13 +162,7 @@ export default class TocWidget extends CollapsibleWidget {
 | 
				
			|||||||
            //
 | 
					            //
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            const headingText = $("<div>").html(m[2]).text();
 | 
					            const headingText = $("<div>").html(m[2]).text();
 | 
				
			||||||
            const $li = $('<li style="cursor:pointer">').text(headingText);
 | 
					            const $li = $('<li>').text(headingText);
 | 
				
			||||||
            // XXX Do this with CSS? How to inject CSS in doRender?
 | 
					 | 
				
			||||||
            $li.hover(function () {
 | 
					 | 
				
			||||||
                $(this).css("font-weight", "bold");
 | 
					 | 
				
			||||||
            }).mouseout(function () {
 | 
					 | 
				
			||||||
                $(this).css("font-weight", "normal");
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            $li.on("click", () => this.jumpToHeading(headingIndex));
 | 
					            $li.on("click", () => this.jumpToHeading(headingIndex));
 | 
				
			||||||
            $ols[$ols.length - 1].append($li);
 | 
					            $ols[$ols.length - 1].append($li);
 | 
				
			||||||
            headingCount = headingIndex;
 | 
					            headingCount = headingIndex;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user