summaryrefslogtreecommitdiff
path: root/editor/actions
diff options
context:
space:
mode:
Diffstat (limited to 'editor/actions')
-rwxr-xr-xeditor/actions/editor_actions.ml23
-rwxr-xr-xeditor/actions/editor_actions.mli2
2 files changed, 16 insertions, 9 deletions
diff --git a/editor/actions/editor_actions.ml b/editor/actions/editor_actions.ml
index 0053890..5b2a3d3 100755
--- a/editor/actions/editor_actions.ml
+++ b/editor/actions/editor_actions.ml
@@ -13,6 +13,7 @@ type t =
; childs : El.t list
; ul : El.t
; mutable completed : bool
+ ; delete_button : El.t
}
let build
@@ -153,6 +154,7 @@ let build
{ ev = result_event
; childs
; ul
+ ; delete_button
; completed = false
}
@@ -175,23 +177,28 @@ let get_notes _ =
[ El.txt name ] ])
let complete
- : t -> State.t Note.event -> El.t list
- = fun ({ childs; ul ; completed ; _ } as t) change ->
+ : t -> State.t Note.signal -> El.t list
+ = fun ({ childs; ul ; completed ; delete_button ; _ } as t) change ->
let () =
if completed then
raise (Failure "The action panel is already registered") in
let note_list =
- Note.E.map get_notes
+ Note.S.map get_notes
change
in
t.completed <- true;
- (* Register all the notes at the creation time *)
- El.set_children ul (get_notes ());
-
- (* Then register updates *)
- Elr.set_children ul ~on:note_list;
+ Elr.def_children ul note_list;
+ Elr.def_at
+ (Jstr.v "disabled")
+ (Note.S.map
+ (fun state ->
+ match state.State.page_id with
+ | None -> Some Jstr.empty
+ | Some _ -> None)
+ change)
+ delete_button;
childs
diff --git a/editor/actions/editor_actions.mli b/editor/actions/editor_actions.mli
index 48d5676..27b09d7 100755
--- a/editor/actions/editor_actions.mli
+++ b/editor/actions/editor_actions.mli
@@ -14,4 +14,4 @@ val get_event
*)
val complete
- : t -> State.t Note.event -> Brr.El.t list
+ : t -> State.t Note.signal -> Brr.El.t list