diff options
Diffstat (limited to 'editor/editor.ml')
-rwxr-xr-x | editor/editor.ml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/editor.ml b/editor/editor.ml index 5883ec8..2441265 100755 --- a/editor/editor.ml +++ b/editor/editor.ml @@ -131,8 +131,14 @@ let app id content = let init_state = State.init pm view last_backup page_id in + (* Initialize the buttons actions and get the associated events. + At this point, the HTML element is not yet created, and cannot be + inserted in the document. + *) let side_elements = Editor_actions.build pm in let btn_events = Editor_actions.get_event side_elements in + + (* Create the main event loop with all the collected events *) let app_state = State.run ~eq:State.eq init_state @@ -146,7 +152,12 @@ let app id content = ; btn_events ]) in + (* Get the html element associated with the buttons, and add it in the + page. + The state event is already created, and can be given in the html + creation in order to update the elements when the state change. + *) let childs = Editor_actions.complete side_elements app_state in let () = El.append_children sidebar childs in let _ = Note.(Logr.hold (S.log app_state (fun _ -> ()))) in |