aboutsummaryrefslogtreecommitdiff
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.ml31
1 files changed, 20 insertions, 11 deletions
diff --git a/editor/actions/editor_actions.ml b/editor/actions/editor_actions.ml
index 91d2a24..518e0c7 100755
--- a/editor/actions/editor_actions.ml
+++ b/editor/actions/editor_actions.ml
@@ -17,8 +17,8 @@ type t =
}
let build
- : unit -> t
- = fun () ->
+ : Prosemirror.t -> t
+ = fun pm ->
let delete_button = El.button
~at:At.[ class' (Jstr.v "action-button") ]
@@ -56,6 +56,16 @@ let build
~at:At.[ class' (Jstr.v "fa")
; class' (Jstr.v "fa-2x")
; class' (Jstr.v "fa-upload") ] ]
+
+ and cog_button = El.button
+ ~at:At.[class' (Jstr.v "action-button")]
+ [ El.i
+ []
+ ~at:At.[ class' (Jstr.v "fa")
+ ; class' (Jstr.v "fa-2x")
+ ; class' (Jstr.v "fa-cog") ]
+ ]
+
in
(* We are waiting for event inside another event ( form validation inside
@@ -89,6 +99,11 @@ let build
Ev.click
(fun _ -> Import.create ())
load_button)
+ and cog_event =
+ Evr.on_el
+ Ev.click
+ (fun _ -> To_markdown.create pm)
+ cog_button
in
@@ -128,14 +143,7 @@ let build
; export_button
; load_button
; delete_button
- ; El.button
- ~at:At.[class' (Jstr.v "action-button")]
- [ El.i
- []
- ~at:At.[ class' (Jstr.v "fa")
- ; class' (Jstr.v "fa-2x")
- ; class' (Jstr.v "fa-cog") ]
- ]
+ ; cog_button
; El.hr ()
; ul ] in
@@ -145,7 +153,8 @@ let build
; redirect_event
; add_event
; export_event
- ; import_event ] in
+ ; import_event
+ ; cog_event ] in
{ ev = result_event
; childs