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/10/13 22:06:54 UTC

[whimsy] branch master updated: update title in one place

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 c19a419  update title in one place
c19a419 is described below

commit c19a419fa71c8053ede1eca8ec28417456017d27
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Fri Oct 13 18:06:22 2017 -0400

    update title in one place
---
 www/board/agenda/views/layout/header.js.rb | 14 --------------
 www/board/agenda/views/layout/main.js.rb   |  3 +++
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/www/board/agenda/views/layout/header.js.rb b/www/board/agenda/views/layout/header.js.rb
index c737fd8..21f2594 100644
--- a/www/board/agenda/views/layout/header.js.rb
+++ b/www/board/agenda/views/layout/header.js.rb
@@ -120,20 +120,6 @@ class Header < Vue
     end
   end
 
-  # set initial title to match the item title
-  def mounted()
-    title = document.getElementsByTagName('title')[0]
-    title.textContent = @@item.title
-  end
-
-  # update title to match the item title whenever page changes
-  def beforeUpdate()
-    title = document.getElementsByTagName('title')[0]
-    if title.textContent != @@item.title
-      title.textContent = @@item.title
-    end
-  end
-
   # toggle info dropdown
   def toggleInfo()
     @infodropdown = (@infodropdown ? nil : 'open')
diff --git a/www/board/agenda/views/layout/main.js.rb b/www/board/agenda/views/layout/main.js.rb
index 3a9e52e..0f85cba 100644
--- a/www/board/agenda/views/layout/main.js.rb
+++ b/www/board/agenda/views/layout/main.js.rb
@@ -62,6 +62,9 @@ class Main < Vue
 
     Main.view = nil unless Main.item and Main.item.view == route.item.view
     Main.item = route.item
+
+    # update title to match the item title whenever page changes
+    document.getElementsByTagName('title')[0].textContent = route.item.title
   end
 
   # navigation method that updates history (back button) information

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