2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
8 YUI.add('dd-gestures', function(Y) {
11 * This module is the conditional loaded DD file to support gesture events.
12 * In the event that DD is loaded onto a device that support touch based events
13 * This module is loaded and over rides 2 key methods on DD.Drag and DD.DDM to
14 * attach the gesture events.
17 Y.DD.Drag.START_EVENT = 'gesturemovestart';
19 Y.DD.Drag.prototype._prep = function() {
20 this._dragThreshMet = false;
21 var node = this.get('node'), DDM = Y.DD.DDM;
23 node.addClass(DDM.CSS_PREFIX + '-draggable');
25 node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {
30 node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });
31 node.on('dragstart', Y.bind(this._fixDragStart, this));
35 Y.DD.DDM._setupListeners = function() {
40 Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), { standAlone: true });
45 }, '3.3.0' ,{skinnable:false, requires:['dd-drag', 'event-synthetic', 'event-gestures']});