style: update padding for body and add early return in day detail function
- Adjusted the bottom padding in `style.css` to improve layout by incorporating a comfortable offset for safe areas. - Added an early return in `dayDetail.js` to prevent further processing when there are no duties or event summaries, enhancing performance and preventing unnecessary DOM manipulations.
This commit is contained in:
@@ -221,6 +221,8 @@ function openDayDetail(cell) {
|
||||
const duties = /** @type {object[]} */ (parseDataAttr(dutiesRaw || ""));
|
||||
const eventSummaries = /** @type {string[]} */ (parseDataAttr(eventsRaw || ""));
|
||||
|
||||
if (duties.length === 0 && eventSummaries.length === 0) return;
|
||||
|
||||
ensurePanelInDom();
|
||||
if (!panelEl) return;
|
||||
|
||||
|
||||
@@ -246,7 +246,8 @@ body {
|
||||
padding-top: 12px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
padding-bottom: max(16px, env(safe-area-inset-bottom));
|
||||
/* Комфортный отступ снизу: safe area + дополнительное поле */
|
||||
padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
|
||||
.day-detail-panel--sheet::before {
|
||||
|
||||
Reference in New Issue
Block a user