Re-focus add input on clicking add item

This commit is contained in:
Nicholas Kariniemi 2014-04-25 21:53:33 +03:00
parent fcab4e9fa8
commit 6bf69abab9
2 changed files with 4 additions and 0 deletions

View file

@ -267,6 +267,9 @@
(defn clear-new-grub-input! [] (defn clear-new-grub-input! []
(dommy/set-value! (sel1 :#add-grub-input) "")) (dommy/set-value! (sel1 :#add-grub-input) ""))
(defn focus-new-grub-input! []
(.focus (sel1 :#add-grub-input)))
(extend-type js/HTMLDivElement (extend-type js/HTMLDivElement
IRecipe IRecipe
(-expand! [this] (-expand! [this]

View file

@ -140,6 +140,7 @@
(dom/-show! dom/clear-all-btn) (dom/-show! dom/clear-all-btn)
(sort-and-render-grub-list! new-grubs) (sort-and-render-grub-list! new-grubs)
(dom/clear-new-grub-input!) (dom/clear-new-grub-input!)
(dom/focus-new-grub-input!)
new-grubs)) new-grubs))
(defn assoc-new-grub [current new] (defn assoc-new-grub [current new]