From 7dca6f71488e1c82b461d8eeaada198bea575f89 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Sun, 25 Oct 2015 21:32:33 +0000 Subject: [PATCH] Update homepage paper components --- index.html | 32 ++++++++++++++++---------------- site-assets/main.js | 12 ++++-------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/index.html b/index.html index f13b95b247..9e51a7a9c9 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ - + @@ -53,29 +53,29 @@

Introduction

Examples

- - - JavaScript - Compile-to-JS - Labs + + JavaScript + Compile-to-JS + Labs -
+

These are examples written in pure JavaScript. @@ -296,7 +296,7 @@

Examples

-
+
  • R = App also demonstrates routing
diff --git a/site-assets/main.js b/site-assets/main.js index 2b0e2d5297..4ba34c440e 100644 --- a/site-assets/main.js +++ b/site-assets/main.js @@ -175,9 +175,10 @@ }]); function AppTabs() { - document.querySelector(AppTabs.selectors.tabs).addEventListener( - 'core-select', this.onSelect.bind(this)); + var tabs = document.querySelector(AppTabs.selectors.tabs); + tabs.addEventListener('iron-select', this.onSelect.bind(this)); this.listHeight = 0; + tabs.select(0); } AppTabs.selectors = { @@ -187,14 +188,9 @@ }; AppTabs.prototype.onSelect = function (e) { - var selected = e.target.selected; + var selected = e.currentTarget.selectedItem.dataset.target; [].slice.call(document.querySelectorAll(AppTabs.selectors.list)).forEach( function (el) { - if (!e.detail.isSelected) { - // Don't handle unselection events. - return; - } - var isSelected = el.dataset.appList === selected; el.style.display = isSelected ? 'block' : 'none'; if (isSelected) {