mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
The draw tool no longer looks up or listens on its controls. It connects toggleDraw, setDrawShape, setDrawColor, setDrawLabel and clearDraw to the display store, which now holds several owners and lets the newest owner of an action answer it, and it publishes the colour and label beside the shape, state and hint. The Draw panel renders the shape choice with UiSegmented and binds the label and colour to what the tool publishes. The label field's own Enter listener goes: the session's capture-phase key handler already finishes the shape from that field.
13 lines
495 B
JavaScript
13 lines
495 B
JavaScript
/**
|
|
* `v-range-value`: a range input's (or a select's or text field's) live
|
|
* value, written only when it differs.
|
|
* A `:value` binding would also rewrite the value attribute on every patch;
|
|
* the directive runs after the element's min, max and step are patched, so
|
|
* the value is never clamped to a stale range.
|
|
*/
|
|
const apply = (el, { value }) => {
|
|
const next = String(value);
|
|
if (el.value !== next) el.value = next;
|
|
};
|
|
export const vRangeValue = { mounted: apply, updated: apply };
|