Swipe left for list items in the works

This commit is contained in:
Max Lynch
2013-10-09 13:30:44 -05:00
parent a5b1a51e6e
commit 5af636989b
7 changed files with 1978 additions and 82 deletions

36
js/views/listView.js Normal file
View File

@ -0,0 +1,36 @@
(function(ionic) {
ionic.views.List = function(opts) {
var _this = this;
this.el = opts.el;
window.ionic.onGesture('swipeleft', function(e) {
_this._handleSwipeLeft(e);
}, this.el);
window.ionic.onGesture('swiperight', function(e) {
_this._handleSwipeRight(e);
}, this.el);
};
ionic.views.List.prototype = {
_handleSwipeLeft: function(e) {
var item = e.target;
if(!item.classList.contains('list-item')) {
return;
}
item.classList.add('slide-left');
},
_handleSwipeRight: function(e) {
var item = e.target;
if(!item.classList.contains('list-item')) {
return;
}
item.classList.remove('slide-left');
}
};
})(ionic);