From 06c83c56dc96e3a75cd10c02b762aee803d2a69f Mon Sep 17 00:00:00 2001 From: lp177 Date: Mon, 3 Oct 2016 06:20:18 +0200 Subject: [PATCH] Add posibility to restore an swipped element Add boolean propertie destroy, with default value true, set him to false for preserve the swiped elements --- iron-swipeable-container.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iron-swipeable-container.html b/iron-swipeable-container.html index 1c8b4c3..374b3fe 100644 --- a/iron-swipeable-container.html +++ b/iron-swipeable-container.html @@ -94,6 +94,13 @@ value: false }, + /** + * If true, destroy the swiped element. + */ + destroy: { + type: Boolean, + value: true + }, /** * The ratio of the width of the element that the translation animation * should happen over. For example, if the `widthRatio` is 3, the @@ -255,7 +262,8 @@ var target = event.currentTarget; if (this._swipeComplete && event.propertyName === 'opacity') { - Polymer.dom(this).removeChild(target); + if ( this.destroy ) + Polymer.dom(this).removeChild(target); this.fire('iron-swipe', { direction: this._direction > 0 ? 'right' : 'left', target:target