From 4e605979ec8d80443d5a0722ea6ebc7227a4e2f3 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Wed, 19 Mar 2014 16:47:52 -0500 Subject: [PATCH] fix(listView): No slide drag if no hidden buttons. Fixes #847 --- js/views/listView.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/js/views/listView.js b/js/views/listView.js index eec0750ffd..c2a8355032 100644 --- a/js/views/listView.js +++ b/js/views/listView.js @@ -441,10 +441,15 @@ // Or check if this is a swipe to the side drag else if(!this._didDragUpOrDown && (e.gesture.direction == 'left' || e.gesture.direction == 'right') && Math.abs(e.gesture.deltaX) > 5) { - this._dragOp = new SlideDrag({ el: this.el }); - this._dragOp.start(e); - e.preventDefault(); - return; + + // Make sure this is an item with buttons + var item = this._getItem(e.target); + if(item && item.querySelector('.item-options')) { + this._dragOp = new SlideDrag({ el: this.el }); + this._dragOp.start(e); + e.preventDefault(); + return; + } } // We aren't handling it, so pass it up the chain