whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [42/50] Commit 88aca84: autofocus
Date Fri, 22 Jan 2016 02:40:58 GMT
Commit 88aca84280a050cbcb4aeb1ca6adf69b2a2c76ad:
    autofocus


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
views/add-comment.js.rb                                      | +++++++ 
------------------------------------------------------------
7 changes: 7 additions, 0 deletions.
------------------------------------------------------------


diff --git a/views/add-comment.js.rb b/views/add-comment.js.rb
index f44b4a4..3a0e5ff 100644
--- a/views/add-comment.js.rb
+++ b/views/add-comment.js.rb
@@ -38,6 +38,13 @@ def render
     end
   end
 
+  # autofocus on comment form
+  def componentDidMount()
+    jQuery('#comment-form').on 'shown.bs.modal' do
+      ~'#comment-text'.focus()
+    end
+  end
+
   # enable/disable save when input changes
   def input(event)
     @save_disabled = ( event.target.value.length == 0 )

Mime
View raw message