~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/dd/dd-gestures-debug.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
 
3
Code licensed under the BSD License:
 
4
http://developer.yahoo.com/yui/license.html
 
5
version: 3.2.0
 
6
build: 2676
 
7
*/
 
8
YUI.add('dd-gestures', function(Y) {
 
9
 
 
10
    /**
 
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.
 
15
    */
 
16
    Y.log('Drag gesture support loaded', 'info', 'drag-gestures');
 
17
 
 
18
    Y.DD.Drag.START_EVENT = 'gesturemovestart';
 
19
 
 
20
    Y.DD.Drag.prototype._prep = function() {
 
21
        Y.log('Using DD override prep to attach gesture events', 'info', 'drag-gestures');
 
22
        this._dragThreshMet = false;
 
23
        var node = this.get('node'), DDM = Y.DD.DDM;
 
24
 
 
25
        node.addClass(DDM.CSS_PREFIX + '-draggable');
 
26
 
 
27
        node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {
 
28
            minDistance: 0,
 
29
            minTime: 0
 
30
        });
 
31
 
 
32
        node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });
 
33
        node.on('dragstart', Y.bind(this._fixDragStart, this));
 
34
 
 
35
    };
 
36
 
 
37
    Y.DD.DDM._setupListeners = function() {
 
38
        var DDM = Y.DD.DDM;
 
39
 
 
40
        this._createPG();
 
41
        this._active = true;
 
42
        Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), { standAlone: true });
 
43
    };
 
44
 
 
45
 
 
46
 
 
47
}, '3.2.0' ,{skinnable:false, requires:['dd-drag', 'event-synthetic', 'event-gestures']});