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/29 13:39:21 UTC

[whimsy] branch master updated: make minutes reactive

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 d6852fa  make minutes reactive
d6852fa is described below

commit d6852fa9ec8cd58a74c4d4b6fea7b22da3037725
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Fri Sep 29 09:39:11 2017 -0400

    make minutes reactive
---
 www/board/agenda/views/models/minutes.js.rb | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/www/board/agenda/views/models/minutes.js.rb b/www/board/agenda/views/models/minutes.js.rb
index 85d919a..35defb4 100644
--- a/www/board/agenda/views/models/minutes.js.rb
+++ b/www/board/agenda/views/models/minutes.js.rb
@@ -3,19 +3,29 @@
 #
 
 class Minutes
-  @@list = {}
+  Vue.util.defineReactive @@list, {}
 
   # (re)-load minutes
   def self.load(list)
-    @@list = {}
+    old_keys = @@list.keys()
 
     if list
       for title in list
-        @@list[title] = list[title]
+        index = old_keys.indexOf(title)
+        if index >= 0
+          @@list[title]=list[title]
+          old_keys.splice(index, 1)
+        else
+          Vue.set @@list, title, list[title]
+        end
       end
     end
 
-    @@list.attendance ||= {}
+    old_keys.each do |key|
+      Vue.delete @@list, key
+    end
+
+    Vue.set @@list, 'attendance', {} unless @@list.attendance
   end
 
   # list of actions created during the meeting

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