Release v2.2.0
This commit is contained in:
@@ -3,6 +3,41 @@
|
||||
return;
|
||||
}
|
||||
|
||||
function updateBackgroundTasksCardHeight() {
|
||||
var card = document.getElementById('background-tasks-task-card');
|
||||
if (!card) {
|
||||
return;
|
||||
}
|
||||
|
||||
var cardRect = card.getBoundingClientRect();
|
||||
var bottomInset = 16;
|
||||
var availableHeight = Math.max(0, window.innerHeight - cardRect.top - bottomInset);
|
||||
card.style.setProperty('--background-tasks-task-card-max-height', availableHeight + 'px');
|
||||
}
|
||||
|
||||
var scheduleUpdate = window.requestAnimationFrame ? function () {
|
||||
window.requestAnimationFrame(updateBackgroundTasksCardHeight);
|
||||
} : updateBackgroundTasksCardHeight;
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener('resize', scheduleUpdate);
|
||||
window.addEventListener('orientationchange', scheduleUpdate);
|
||||
window.addEventListener('load', scheduleUpdate);
|
||||
}
|
||||
|
||||
if (window.ResizeObserver) {
|
||||
try {
|
||||
var summary = document.getElementById('background-tasks-summary');
|
||||
if (summary) {
|
||||
new ResizeObserver(scheduleUpdate).observe(summary);
|
||||
}
|
||||
} catch (_error) {
|
||||
// Ignore ResizeObserver setup failures.
|
||||
}
|
||||
}
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
try {
|
||||
var url = new URL(window.location.href);
|
||||
if (!url.searchParams.has('message')) {
|
||||
|
||||
Reference in New Issue
Block a user