From 3a0d1418503c237445f71aeba4acdee4efd3f111 Mon Sep 17 00:00:00 2001 From: Brian McBride Date: Sat, 11 Mar 2017 19:14:12 -0800 Subject: [PATCH 1/2] iron-swipeable-pages 2.0 Thanks for the component! I'm working on a 2.0 project and thought I'd convert this over. No logic changed, just formatting for 2.0, converting to and the listener changes. --- iron-swipeable-pages.html | 464 +++++++++++++++++++++++++++++++++++--- 1 file changed, 437 insertions(+), 27 deletions(-) diff --git a/iron-swipeable-pages.html b/iron-swipeable-pages.html index f96ddcf..f860011 100644 --- a/iron-swipeable-pages.html +++ b/iron-swipeable-pages.html @@ -1,4 +1,4 @@ - + @@ -474,23 +474,436 @@ _selectPage: function(page) { var index = this.indexOf(page); + + + + + + } + window.customElements.define(IronSwipeablePages.is, IronSwipeablePages); + From 3dd5d04f0273daf2a4fbffb8de2d39d81c6726a7 Mon Sep 17 00:00:00 2001 From: Brian McBride Date: Sat, 11 Mar 2017 19:33:11 -0800 Subject: [PATCH 2/2] Fixing canCycle Broke it simplifying if statement.. whoops --- iron-swipeable-pages.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iron-swipeable-pages.html b/iron-swipeable-pages.html index f860011..47e23bb 100644 --- a/iron-swipeable-pages.html +++ b/iron-swipeable-pages.html @@ -927,7 +927,10 @@ if (index === 0 && trackData.dx > 0) { return false; } - return (index === this.items.length - 1 && trackData.dx < 0); + if (index === this.items.length - 1 && trackData.dx < 0) { + return false; + } + return true; } _getOffsetWidth() {