Commit 6f810e4a authored by Kim Nguyễn's avatar Kim Nguyễn

[trywhy3] Switch focus to the task list tab when the buffer is recompiled.

parent 273dfdc1
......@@ -97,11 +97,11 @@
<div id="why3-resize-bar" class="why3-widget" ></div>
<div id="why3-tab-container" class="why3-container">
<div id="why3-tab-panel" class="why3-tab-group">
<span class="why3-tab-label why3-widget" >Task list</span>
<span id="why3-task-list-tab" class="why3-tab-label why3-widget" >Task list</span>
<div class="why3-widget why3-tab">
<div id="why3-task-list" class="why3-widget"></div>
</div>
<span class="why3-tab-label why3-widget why3-inactive" >Task view</span>
<span id="why3-task-view-tab" class="why3-tab-label why3-widget why3-inactive" >Task view</span>
<div class="why3-widget why3-tab"><div id="why3-task-viewer"></div></div>
</div>
</div>
......
......@@ -275,19 +275,23 @@ module Tabs =
List.iter
(fun tab_group ->
let labels = select tab_group ".why3-tab-label" in
List.iter (
List.iter
(fun tab ->
tab ## onclick <-
Dom.handler
(fun _ev ->
List.iter
(fun t ->
ignore (t ## classList ## toggle (Js.string "why3-inactive")))
labels;
Js._false))
) labels)
tab_groups
(fun _ev ->
let () = if Js.to_bool
(tab ## classList ## contains (Js.string "why3-inactive")) then
List.iter
(fun t ->
ignore (t ## classList ## toggle (Js.string "why3-inactive")))
labels
in
Js._false)
) labels)
tab_groups
let focus id =
(Dom_html.getElementById id) ## click ()
end
module ContextMenu =
......@@ -941,6 +945,7 @@ module Controller =
let () = why3_worker := Some (init_why3_worker ())
let why3_parse () =
Tabs.focus "why3-task-list-tab";
ToolBar.disable_compile ();
why3_busy := true;
TaskList.clear ();
......@@ -952,6 +957,7 @@ module Controller =
(get_why3_worker()) ## postMessage (msg)
let why3_execute () =
Tabs.focus "why3-task-list-tab";
ToolBar.disable_compile ();
why3_busy := true;
TaskList.clear ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment