whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: update filename as fullname changes
Date Sun, 02 Apr 2017 12:23:59 GMT
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  e80fbd5   update filename as fullname changes
e80fbd5 is described below

commit e80fbd553988e745a9d9bd0a08f8be90fe47b750
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Apr 2 08:23:48 2017 -0400

    update filename as fullname changes
---
 www/secmail/views/forms/memapp.js.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/secmail/views/forms/memapp.js.rb b/www/secmail/views/forms/memapp.js.rb
index 24f1814..d721542 100644
--- a/www/secmail/views/forms/memapp.js.rb
+++ b/www/secmail/views/forms/memapp.js.rb
@@ -36,7 +36,7 @@ class MemApp < React
           end
           _td do
             _input type: :text, name: 'fullname', id: 'fullname', value: @name,
-              disabled: @filed
+              disabled: @filed, onChange: self.changeFullName
           end
         end
 
@@ -122,6 +122,12 @@ class MemApp < React
     window.addEventListener 'message', self.status_update
   end
 
+  # when fullname changes, change filename
+  def changeFullName(event)
+    @name = event.target.value
+    @filename = asciize(event.target.value).downcase().gsub(/\W+/, '-')
+  end
+
   # when id is selected, default full name and filename
   def setid(event)
     id = event.target.value

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

Mime
View raw message