mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
More events for layers, align, colors and swap name <=> category (#2442)
This commit is contained in:
parent
0ef60dce2d
commit
668150a667
9 changed files with 96 additions and 43 deletions
|
@ -2,6 +2,7 @@ import { AppState } from "./types";
|
|||
import { ExcalidrawElement } from "./element/types";
|
||||
import { getElementsInGroup } from "./groups";
|
||||
import { findLastIndex, findIndex } from "./utils";
|
||||
import { trackEvent, EVENT_LAYER } from "./analytics";
|
||||
|
||||
/**
|
||||
* Returns indices of elements to move based on selected elements.
|
||||
|
@ -175,6 +176,7 @@ const shiftElements = (
|
|||
];
|
||||
});
|
||||
|
||||
trackEvent(EVENT_LAYER, "move", direction === "left" ? "down" : "up");
|
||||
return elements;
|
||||
};
|
||||
|
||||
|
@ -232,6 +234,7 @@ const shiftElementsToEnd = (
|
|||
const leadingElements = elements.slice(0, leadingIndex);
|
||||
const trailingElements = elements.slice(trailingIndex + 1);
|
||||
|
||||
trackEvent(EVENT_LAYER, "move", direction === "left" ? "back" : "front");
|
||||
return direction === "left"
|
||||
? [
|
||||
...leadingElements,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue