Skip to content

Commit 1caa71d

Browse files
committed
unfocus tabs after clicking (fixes #22)
1 parent 91b8167 commit 1caa71d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/tree_annotation/core.cljs

+9-4
Original file line numberDiff line numberDiff line change
@@ -366,27 +366,32 @@ This is an open source project. Find the code [here](https://github.com/DCMLab/t
366366
; App component ;
367367
;---------------;
368368

369+
(defn unfocus [action!]
370+
(fn [ev]
371+
(.. ev -target blur)
372+
(action!)))
373+
369374
(defn tab-component []
370375
[:div.pure-menu.pure-menu-horizontal
371376
[:ul.pure-menu-list
372377
[:li.pure-menu-item
373378
{:class (if (db/show-input?) "pure-menu-selected" "")}
374379
[:a.pure-menu-link
375-
{:on-click db/toggle-input! :href "javascript:;"}
380+
{:on-click (unfocus db/toggle-input!) :href "javascript:;"}
376381
"Input"]]
377382
[:li.pure-menu-item
378383
{:class (if (db/show-output?) "pure-menu-selected" "")}
379384
[:a.pure-menu-link
380-
{:on-click db/toggle-output! :href "javascript:;"}
385+
{:on-click (unfocus db/toggle-output!) :href "javascript:;"}
381386
"Output"]]
382387
[:li.pure-menu-item
383388
{:class (if (db/show-preview?) "pure-menu-selected" "")}
384389
[:a.pure-menu-link
385-
{:on-click db/toggle-preview! :href "javascript:;"}
390+
{:on-click (unfocus db/toggle-preview!) :href "javascript:;"}
386391
"Preview"]][:li.pure-menu-item
387392
{:class (if (db/show-manual?) "pure-menu-selected" "")}
388393
[:a.pure-menu-link
389-
{:on-click db/toggle-manual! :href "javascript:;"}
394+
{:on-click (unfocus db/toggle-manual!) :href "javascript:;"}
390395
"Help"]]]])
391396

392397
(defn app-component []

0 commit comments

Comments
 (0)