diff --git a/src/apps/billboard/static/apps/billboard/note-page.js b/src/apps/billboard/static/apps/billboard/note-page.js index 5954be6..6aa48d3 100644 --- a/src/apps/billboard/static/apps/billboard/note-page.js +++ b/src/apps/billboard/static/apps/billboard/note-page.js @@ -1,9 +1,10 @@ (function () { 'use strict'; - var _state = 'closed'; // 'closed' | 'open' | 'previewing' var _selectedPalette = null; var _activeItem = null; + var _originalPalette = null; + var _dismissTimer = null; // ── helpers ────────────────────────────────────────────────────────────── @@ -15,6 +16,22 @@ return Array.from(el.classList).find(function (c) { return c.startsWith('palette-'); }) || ''; } + function _currentBodyPalette() { + return Array.from(document.body.classList).find(function (c) { return c.startsWith('palette-'); }) || null; + } + + function _swapBodyPalette(paletteName) { + var old = _currentBodyPalette(); + if (old) document.body.classList.remove(old); + document.body.classList.add(paletteName); + } + + function _revertBodyPalette() { + var current = _currentBodyPalette(); + if (current) document.body.classList.remove(current); + if (_originalPalette) document.body.classList.add(_originalPalette); + } + function _getCsrf() { var m = document.cookie.match(/csrftoken=([^;]+)/); return m ? m[1] : ''; @@ -23,7 +40,6 @@ // ── modal lifecycle ─────────────────────────────────────────────────────── function _openModal() { - // Clone from