dd-gestures-debug.js revision 0d180d8e4c2312966d048c9ef6f4c1e50b25ddf0
82d0cf8c731b23f6a2fbb31e3e696e629444363eTrippYUI.add('dd-gestures', function(Y) {
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp /**
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * This module is the conditional loaded DD file to support gesture events.
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * In the event that DD is loaded onto a device that support touch based events
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * This module is loaded and over rides 2 key methods on DD.Drag and DD.DDM to
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp * attach the gesture events.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp */
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp Y.log('Drag gesture support loaded', 'info', 'drag-gestures');
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp Y.DD.Drag.START_EVENT = 'gesturemovestart';
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp Y.DD.Drag.prototype._prep = function() {
87a49173dbc22a145cb87e605cca83fd42524377Tripp Y.log('Using DD override prep to attach gesture events', 'info', 'drag-gestures');
87a49173dbc22a145cb87e605cca83fd42524377Tripp this._dragThreshMet = false;
87a49173dbc22a145cb87e605cca83fd42524377Tripp var node = this.get('node'), DDM = Y.DD.DDM;
87a49173dbc22a145cb87e605cca83fd42524377Tripp
87a49173dbc22a145cb87e605cca83fd42524377Tripp node.addClass(DDM.CSS_PREFIX + '-draggable');
87a49173dbc22a145cb87e605cca83fd42524377Tripp
87a49173dbc22a145cb87e605cca83fd42524377Tripp node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {
87a49173dbc22a145cb87e605cca83fd42524377Tripp minDistance: 0,
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp minTime: 0
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp });
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp node.on('dragstart', Y.bind(this._fixDragStart, this));
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp };
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp Y.DD.DDM._setupListeners = function() {
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp var DDM = Y.DD.DDM;
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp this._createPG();
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp this._active = true;
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), { standAlone: true });
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp };
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp}, '@VERSION@' ,{skinnable:false, requires:['dd-drag', 'event-synthetic', 'event-gestures']});
2b02938d1550d7e1cea52d019c56997ff08d40c3Tripp