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/07 11:29:12 UTC

[whimsy] 04/05: try out vue events

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

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

commit 647c4c42ecfebe8414857f0eb33ffb23b7240ded
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Sep 7 07:10:20 2017 -0400

    try out vue events
---
 www/roster/views/pmc/add.js.rb  | 3 ++-
 www/roster/views/pmc/main.js.rb | 4 ++--
 www/roster/views/pmc/mod.js.rb  | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/www/roster/views/pmc/add.js.rb b/www/roster/views/pmc/add.js.rb
index cb27e71..0b77efa 100644
--- a/www/roster/views/pmc/add.js.rb
+++ b/www/roster/views/pmc/add.js.rb
@@ -106,11 +106,12 @@ class PMCAdd < Vue
         content_type = response.headers.get('content-type') || ''
         if response.status == 200 and content_type.include? 'json'
           response.json().then do |json|
-            @@update.call(json)
+            Vue.emit :update, json
           end
         else
           alert "#{response.status} #{response.statusText}"
         end
+
         jQuery('#pmcadd').modal(:hide)
         @disabled = false
       }.catch {|error|
diff --git a/www/roster/views/pmc/main.js.rb b/www/roster/views/pmc/main.js.rb
index c632e94..20976d5 100644
--- a/www/roster/views/pmc/main.js.rb
+++ b/www/roster/views/pmc/main.js.rb
@@ -186,8 +186,8 @@ class PMC < Vue
     # hidden forms
     if auth
       _Confirm action: :committee, project: @committee.id, update: self.update
-      _PMCAdd committee: @@committee, update: self.update
-      _PMCMod committee: @@committee, update: self.update
+      _PMCAdd committee: @@committee, onUpdate: self.update
+      _PMCMod committee: @@committee, onUpdate: self.update
     end
   end
 
diff --git a/www/roster/views/pmc/mod.js.rb b/www/roster/views/pmc/mod.js.rb
index fb5d8e7..e6152df 100644
--- a/www/roster/views/pmc/mod.js.rb
+++ b/www/roster/views/pmc/mod.js.rb
@@ -112,11 +112,12 @@ class PMCMod < Vue
         content_type = response.headers.get('content-type') || ''
         if response.status == 200 and content_type.include? 'json'
           response.json().then do |json|
-            @@update.call(json)
+            Vue.emit :update, json
           end
         else
           alert "#{response.status} #{response.statusText}"
         end
+
         jQuery('#pmcmod').modal(:hide)
         @disabled = false
       }.catch {|error|

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