2
YUI 3.10.3 (build 2fb5187)
3
Copyright 2013 Yahoo! Inc. All rights reserved.
4
Licensed under the BSD License.
5
http://yuilibrary.com/license/
8
YUI.add('dd-ddm', function (Y, NAME) {
12
* Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable
13
* anode to drag to be dragged over an iframe or any other node that traps mousemove events.
14
* It is also required to have Drop Targets enabled, as the viewport shim will contain the shims for the Drop Targets.
22
* The shim placed over the screen to track the mousemove event.
29
* Set this to true to set the shims opacity to .5 for debugging it, default: false.
31
* @property _debugShim
35
_activateTargets: function() { },
36
_deactivateTargets: function() {},
37
_startDrag: function() {
38
if (this.activeDrag && this.activeDrag.get('useShim')) {
39
this._shimming = true;
41
this._activateTargets();
44
_endDrag: function() {
45
this._pg_deactivate();
46
this._deactivateTargets();
49
* Deactivates the shim
51
* @method _pg_deactivate
53
_pg_deactivate: function() {
54
this._pg.setStyle('display', 'none');
59
* @method _pg_activate
61
_pg_activate: function() {
65
var ah = this.activeDrag.get('activeHandle'), cur = 'auto';
67
cur = ah.getStyle('cursor');
70
cur = this.get('dragCursor');
78
opacity: ((this._debugShim) ? '.5' : '0'),
83
* Sizes the shim on: activatation, window:scroll, window:resize
87
_pg_size: function() {
88
if (this.activeDrag) {
89
var b = Y.one('body'),
90
h = b.get('docHeight'),
91
w = b.get('docWidth');
99
* Creates the shim and adds it's listeners to it.
103
_createPG: function() {
104
var pg = Y.Node.create('<div></div>'),
105
bd = Y.one('body'), win;
109
position: 'absolute',
112
backgroundColor: 'red',
117
pg.set('id', Y.stamp(pg));
118
pg.addClass(Y.DD.DDM.CSS_PREFIX + '-shim');
121
this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime')));
122
this._pg.on('mouseup', Y.bind(this._end, this));
125
Y.on('window:resize', Y.bind(this._pg_size, this));
126
win.on('scroll', Y.bind(this._pg_size, this));
133
}, '3.10.3', {"requires": ["dd-ddm-base", "event-resize"]});