Skip to content

Commit

Permalink
TouchScroll: expose number of active touches as _touches for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth G. Franqueiro committed Sep 20, 2012
1 parent bc88d83 commit 1867a51
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions TouchScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,10 @@ function(declare, on, has, put){
}

function incrementTouchCount(evt){
touches[evt.widget.id] += evt.changedTouches.length;
evt.widget._touches = touches[evt.widget.id] += evt.changedTouches.length;
}
function decrementTouchCount(evt){
touches[evt.widget.id] -= evt.changedTouches.length;
evt.widget._touches = touches[evt.widget.id] -= evt.changedTouches.length;
}

return declare([], {
Expand All @@ -530,6 +530,12 @@ function(declare, on, has, put){
// (i.e. bouncing back from beyond edges) should take.
bounceDuration: 300,

// _touches: Number
// Reports number of touches currently in contact with this widget.
// Mostly used internally for determining when to scroll, but may also
// be useful info for further extensions.
_touches: 0,

startup: function(){
if(!this._started){
this._initTouch();
Expand Down

0 comments on commit 1867a51

Please sign in to comment.