File tree 2 files changed +24
-7
lines changed
2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -140,19 +140,28 @@ async function renderTooltip(note: FNote | null) {
140
140
}
141
141
142
142
const noteTitleWithPathAsSuffix = await treeService . getNoteTitleWithPathAsSuffix ( bestNotePath ) ;
143
- let content = "" ;
144
- if ( noteTitleWithPathAsSuffix ) {
145
- content = `<h5 class="note-tooltip-title">${ noteTitleWithPathAsSuffix . prop ( "outerHTML" ) } </h5>` ;
146
- }
147
143
148
144
const { $renderedAttributes } = await attributeRenderer . renderNormalAttributes ( note ) ;
149
145
150
146
const { $renderedContent } = await contentRenderer . getRenderedContent ( note , {
151
147
tooltip : true ,
152
148
trim : true
153
149
} ) ;
150
+ const isContentEmpty = ( $renderedContent [ 0 ] . innerHTML . length === 0 ) ;
154
151
155
- content = `${ content } <div class="note-tooltip-attributes">${ $renderedAttributes [ 0 ] . outerHTML } </div>${ $renderedContent [ 0 ] . outerHTML } ` ;
152
+ let content = "" ;
153
+ if ( noteTitleWithPathAsSuffix ) {
154
+ const classes = [ "note-tooltip-title" ] ;
155
+ if ( isContentEmpty ) {
156
+ classes . push ( "note-no-content" ) ;
157
+ }
158
+ content = `<h5 class="${ classes . join ( " " ) } ">${ noteTitleWithPathAsSuffix . prop ( "outerHTML" ) } </h5>` ;
159
+ }
160
+
161
+ content = `${ content } <div class="note-tooltip-attributes">${ $renderedAttributes [ 0 ] . outerHTML } </div>` ;
162
+ if ( ! isContentEmpty ) {
163
+ content += $renderedContent [ 0 ] . outerHTML ;
164
+ }
156
165
157
166
return content ;
158
167
}
Original file line number Diff line number Diff line change @@ -1206,13 +1206,21 @@ body .calendar-dropdown-widget .calendar-body a:hover {
1206
1206
1207
1207
.note-tooltip-content {
1208
1208
padding : 8px ;
1209
+ min-height : 56px ;
1209
1210
}
1210
1211
1211
- .note-tooltip-content .note-title-with-path {
1212
+ .note-tooltip-title .note-title-with-path {
1212
1213
display : flex;
1213
1214
flex-direction : column-reverse;
1214
- border-bottom : 2px solid currentColor;
1215
+ }
1216
+
1217
+ .note-tooltip-title .note-no-content {
1218
+ margin : 0 ;
1219
+ }
1220
+
1221
+ .note-tooltip-title : not (.note-no-content ) .note-title-with-path {
1215
1222
padding-bottom : 6px ;
1223
+ border-bottom : 2px solid currentColor;
1216
1224
}
1217
1225
1218
1226
.note-tooltip-content .note-path {
You can’t perform that action at this time.
0 commit comments