mirror of
https://github.com/usetrmnl/trmnl-picker.git
synced 2026-04-29 13:44:02 -07:00
Rework state management, public API, and events; DRY up state changes
This commit is contained in:
+2
-1
@@ -483,6 +483,7 @@
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<h2>trmnl:change event</h2>
|
||||
<pre id="event-output">Waiting for picker to load...</pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -493,7 +494,7 @@
|
||||
|
||||
// Listen for changes (including initial state)
|
||||
// Attach listener BEFORE creating picker to catch initial event
|
||||
document.getElementById('picker-form').addEventListener('trmnl:changed', (event) => {
|
||||
document.getElementById('picker-form').addEventListener('trmnl:change', (event) => {
|
||||
// Display event data
|
||||
document.getElementById('event-output').textContent = JSON.stringify(event.detail, null, 2)
|
||||
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ pre {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.screen-preview h2 {
|
||||
h2 {
|
||||
margin: 0 0 1.5rem 0;
|
||||
color: #333;
|
||||
font-size: 1.25rem;
|
||||
|
||||
+142
-280
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user