Skip to content

Commit cdf377d

Browse files
Restore dashboard rail visibility while keeping widget clamp
1 parent bb6e2b4 commit cdf377d

2 files changed

Lines changed: 11 additions & 27 deletions

File tree

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/dashboard.js

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,7 @@ const isDashboardNodeVisible = (node) => {
319319
}
320320
current = current.parentElement;
321321
}
322-
const rect = typeof node.getBoundingClientRect === 'function' ? node.getBoundingClientRect() : null;
323-
if (!rect) {
324-
return false;
325-
}
326-
return rect.width > 1 && rect.height > 1;
322+
return node.getClientRects().length > 0;
327323
};
328324
const isDashboardWidgetCollapsedForType = (type) => {
329325
const resolvedType = type === 'vm' ? 'vm' : 'docker';
@@ -332,28 +328,18 @@ const isDashboardWidgetCollapsedForType = (type) => {
332328
return true;
333329
}
334330
const $updatedRow = getDashboardWidgetUpdatedRowForType(resolvedType);
335-
if ($updatedRow.length) {
336-
const updatedNode = $updatedRow.get(0);
337-
const style = updatedNode ? window.getComputedStyle(updatedNode) : null;
338-
if (style && (style.display === 'none' || style.visibility === 'hidden')) {
339-
return true;
340-
}
341-
const rect = updatedNode && typeof updatedNode.getBoundingClientRect === 'function'
342-
? updatedNode.getBoundingClientRect()
343-
: null;
344-
if (rect && (rect.width < 8 || rect.height < 8)) {
345-
return true;
346-
}
347-
}
348-
const $headerRow = $tbody.children('tr').not('.updated').first();
349-
const iconClass = String(
350-
$headerRow.find('a.switch i, .switch i').first().attr('class')
351-
|| ''
352-
).toLowerCase();
353-
if (iconClass.includes('angle-down') || iconClass.includes('chevron-down')) {
331+
if (!$updatedRow.length) {
332+
return true;
333+
}
334+
const updatedNode = $updatedRow.get(0);
335+
if (!updatedNode) {
336+
return true;
337+
}
338+
const style = window.getComputedStyle(updatedNode);
339+
if (!style || style.display === 'none' || style.visibility === 'hidden') {
354340
return true;
355341
}
356-
return false;
342+
return !isDashboardNodeVisible(updatedNode);
357343
};
358344
const getFirstVisibleDashboardFolderCardForType = (type) => {
359345
const $cards = getDashboardFolderCardsForType(type);

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/styles/dashboard.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@
8888
margin: 0;
8989
padding: 0;
9090
box-sizing: border-box;
91-
max-height: calc(100% - 2px);
92-
overflow: hidden;
9391
pointer-events: none;
9492
}
9593

0 commit comments

Comments
 (0)