You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2021/08/20 16:17:01 UTC

[whimsy] branch master updated: Lambda is getting long; use function instead

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

sebb 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 ffabf32  Lambda is getting long; use function instead
ffabf32 is described below

commit ffabf3241414aae7fb1654d6fdd2a9bbe557a4ee
Author: Sebb <se...@apache.org>
AuthorDate: Fri Aug 20 17:16:55 2021 +0100

    Lambda is getting long; use function instead
---
 www/secretary/workbench/views/forms/icla.js.rb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/www/secretary/workbench/views/forms/icla.js.rb b/www/secretary/workbench/views/forms/icla.js.rb
index 6480860..33091c6 100644
--- a/www/secretary/workbench/views/forms/icla.js.rb
+++ b/www/secretary/workbench/views/forms/icla.js.rb
@@ -13,7 +13,7 @@ class ICLA < Vue
 
     _div.buttons do
       _button 'clear form', disabled: @filed,
-        onClick: lambda {@pubname = @realname = @email = @filename = ''}
+        onClick: lambda {clear_form()}
       _button 'Use mail data', disabled: @filed,
         onClick: lambda {process_response({})}
       _button (@pdfdata.nil? ? 'Parse/use PDF data' : @pdfdisabled ? 'No PDF data found' : 'Use PDF data'),
@@ -163,6 +163,14 @@ class ICLA < Vue
     @pdfproject = parsed.PDFProject
   end
 
+  # TODO: should this be called by process_response() ?
+  def clear_form()
+    @pubname = @realname = @email = @filename = @user = ''
+    @project = @pdfproject = ''
+    @votelink = ''
+    @familyfirst = false
+  end
+
   def getpdfdata()
     if @pdfdata # use existing data if present
       process_response(@pdfdata)