Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
use .items instead of .children.
Browse files Browse the repository at this point in the history
Prevents gotchas when using `<template repeat>` inside of <core-pages>. Template will be counted as a child.
  • Loading branch information
ebidel committed Jun 17, 2014
1 parent 55e8a4c commit fd9b3ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@

<script>
document.querySelector('#first').onclick = function(e) {
this.selected = (this.selected + 1) % this.children.length;
this.selected = (this.selected + 1) % this.items.length;
};

document.querySelector('core-pages.fancy').onclick = function(e) {
this.selected = (this.selected + 1) % this.children.length;
this.selected = (this.selected + 1) % this.items.length;
this.async(function() {
if (this.selectedIndex == 0) {
this.selectedItem.classList.remove('begin');
} else if (this.selectedIndex == this.children.length - 1) {
} else if (this.selectedIndex == this.items.length - 1) {
this.items[0].classList.add('begin');
}
});
Expand Down

0 comments on commit fd9b3ee

Please sign in to comment.