summaryrefslogtreecommitdiff
path: root/editor/actions/editor_actions.ml
diff options
context:
space:
mode:
Diffstat (limited to 'editor/actions/editor_actions.ml')
-rwxr-xr-xeditor/actions/editor_actions.ml23
1 files changed, 15 insertions, 8 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