You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/09/11 01:39:06 UTC

[whimsy] branch master updated: clear people list when modal is dismissed

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new d5bb208  clear people list when modal is dismissed
d5bb208 is described below

commit d5bb208b3123a18fd66bde04c338e1400faa11e5
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sun Sep 10 21:38:18 2017 -0400

    clear people list when modal is dismissed
    
    autofocus on the correct input field
---
 www/roster/views/mixins/add.js.rb | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/www/roster/views/mixins/add.js.rb b/www/roster/views/mixins/add.js.rb
index 50c4ae0..e01283c 100644
--- a/www/roster/views/mixins/add.js.rb
+++ b/www/roster/views/mixins/add.js.rb
@@ -4,9 +4,16 @@
 
 class ProjectAdd < Vue::Mixin
   def mounted()
+    # autofocus when modal is shown
     jQuery("##{$options.add_tag}").on('show.bs.modal') do |event|
-      button = event.relatedTarget
-      setTimeout(500) { jQuery("##{$options.add_tag} input").focus() }
+      setTimeout(500) do
+         jQuery("##{$options.add_tag} input[autofocus]").focus()
+      end
+    end
+
+    # clear input when modal is dismissed
+    jQuery("##{$options.add_tag}").on('hidden.bs.modal') do |event|
+      @people = []
     end
   end
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].