mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 03:08:13 +08:00
Split widget callbacks into update and commit so only the latter adds a history state (#1584)
* feat: split commit and update layout * feat: add on_commit callback * Code review * fix: refactor --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
f25038067e
commit
9530e55ace
@@ -31,7 +31,7 @@
|
||||
|
||||
const editor = getContext<Editor>("editor");
|
||||
|
||||
const dispatch = createEventDispatcher<{ color: Color }>();
|
||||
const dispatch = createEventDispatcher<{ color: Color; start: undefined }>();
|
||||
|
||||
export let color: Color;
|
||||
export let allowNone = false;
|
||||
@@ -149,6 +149,8 @@
|
||||
function addEvents() {
|
||||
document.addEventListener("pointermove", onPointerMove);
|
||||
document.addEventListener("pointerup", onPointerUp);
|
||||
|
||||
dispatch("start");
|
||||
}
|
||||
|
||||
function removeEvents() {
|
||||
|
||||
Reference in New Issue
Block a user