~bjornt/lazr-js/prefetch-yui-3.5

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/event-gestures/event-flick.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-01-14 23:32:29 UTC
  • mfrom: (197.1.7 yui-3.3.0)
  • Revision ID: launchpad@pqm.canonical.com-20110114233229-r6i4cazdiiw18o7p
Upgrade to YUI 3.3.0 [r=mars]

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.2.0
6
 
build: 2676
 
5
version: 3.3.0
 
6
build: 3167
7
7
*/
8
8
YUI.add('event-flick', function(Y) {
9
9
 
213
213
                    endEvent.pageY - start.pageY
214
214
                ];
215
215
 
216
 
                axis = params.axis || (Math.abs(xyDistance[0]) >= Math.abs(xyDistance[1])) ? 'x' : 'y';
 
216
                if (params.axis) {
 
217
                    axis = params.axis;
 
218
                } else {
 
219
                    axis = (Math.abs(xyDistance[0]) >= Math.abs(xyDistance[1])) ? 'x' : 'y';
 
220
                }
 
221
 
217
222
                distance = xyDistance[(axis === 'x') ? 0 : 1];
218
223
                velocity = (time !== 0) ? distance/time : 0;
219
224
 
243
248
});
244
249
 
245
250
 
246
 
}, '3.2.0' ,{requires:['node-base','event-touch','event-synthetic']});
 
251
}, '3.3.0' ,{requires:['node-base','event-touch','event-synthetic']});