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: key off of choice.outcome; standardize on camecase for installPrompt
Date Sun, 10 Jun 2018 16:36:46 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 b027d67  key off of choice.outcome; standardize on camecase for installPrompt
b027d67 is described below

commit b027d6728d7ee99732442200e795824674e48219
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Jun 10 12:36:08 2018 -0400

    key off of choice.outcome; standardize on camecase for installPrompt
---
 www/board/agenda/views/buttons/install.js.rb  |  8 ++++----
 www/board/agenda/views/models/pagecache.js.rb | 10 +++++-----
 www/board/agenda/views/router.js.rb           |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/www/board/agenda/views/buttons/install.js.rb b/www/board/agenda/views/buttons/install.js.rb
index ab27433..65d8d8c 100644
--- a/www/board/agenda/views/buttons/install.js.rb
+++ b/www/board/agenda/views/buttons/install.js.rb
@@ -7,10 +7,10 @@ class Install < Vue
   end
 
   def click(event)
-    PageCache.installprompt.prompt();
-    PageCache.installprompt.userChoice.then do |result|
-      console.log "install: #{result}"
-      PageCache.installprompt = nil
+    PageCache.installPrompt.prompt();
+    PageCache.installPrompt.userChoice.then do |choice|
+      console.log "install: #{choice.outcome}"
+      PageCache.installPrompt = nil if choice.outcome == 'accepted'
       Main.refresh()
     end
   end
diff --git a/www/board/agenda/views/models/pagecache.js.rb b/www/board/agenda/views/models/pagecache.js.rb
index 409273b..158445c 100644
--- a/www/board/agenda/views/models/pagecache.js.rb
+++ b/www/board/agenda/views/models/pagecache.js.rb
@@ -75,7 +75,7 @@ class PageCache
     end
 
     window.addEventListener :beforeinstallprompt do |event|
-      @@installprompt = event
+      @@installPrompt = event
       Main.refresh() if Main.item.view == Help
       event.preventDefault();
     end
@@ -124,11 +124,11 @@ class PageCache
   end
 
   # install prompt support
-  def self.installprompt
-    @@installprompt
+  def self.installPrompt
+    @@installPrompt
   end
 
-  def self.installprompt=(value)
-    @@installprompt = value
+  def self.installPrompt=(value)
+    @@installPrompt = value
   end
 end
diff --git a/www/board/agenda/views/router.js.rb b/www/board/agenda/views/router.js.rb
index a4af9d0..729f518 100644
--- a/www/board/agenda/views/router.js.rb
+++ b/www/board/agenda/views/router.js.rb
@@ -86,7 +86,7 @@ class Router
       item = {view: Help}
 
       # Progressive Web Application 'Add to Home Screen' support
-      item.buttons = [{button: Install}] if PageCache.installprompt
+      item.buttons = [{button: Install}] if PageCache.installPrompt
 
     elsif path == 'bootstrap.html'
       item = {view: BootStrapPage, title: ' '}

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.

Mime
View raw message