From 60f637e9473ef77cbc2e413aa101ad8de9c9b987 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Jul 2024 12:40:40 +0200 Subject: [PATCH] :sparkles: Add parent property to shapes --- frontend/src/app/plugins/shape.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/app/plugins/shape.cljs b/frontend/src/app/plugins/shape.cljs index 2ae9b0d399..62d31bb9bf 100644 --- a/frontend/src/app/plugins/shape.cljs +++ b/frontend/src/app/plugins/shape.cljs @@ -819,6 +819,13 @@ :else (st/emit! (dw/update-position id {:y value})))))} + {:name "parent" + ;; not enumerable so there are no infinite loops + :enumerable false + :get (fn [self] + (let [shape (u/proxy->shape self) + parent-id (:parent-id shape)] + (shape-proxy (obj/get self "$file") (obj/get self "$page") parent-id)))} {:name "parentX" :get (fn [self] (let [shape (u/proxy->shape self)