Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/DraggableList.js
Show All 38 Lines | properties : { | ||||
findItemsHandler : null | findItemsHandler : null | ||||
}, | }, | ||||
members : { | members : { | ||||
_root : null, | _root : null, | ||||
_dragging : null, | _dragging : null, | ||||
_locked : 0, | _locked : 0, | ||||
_origin : null, | _origin : null, | ||||
_originScroll : null, | |||||
_target : null, | _target : null, | ||||
_targets : null, | _targets : null, | ||||
_dimensions : null, | _dimensions : null, | ||||
_ghostHandler : null, | _ghostHandler : null, | ||||
_ghostNode : null, | _ghostNode : null, | ||||
_group : null, | _group : null, | ||||
getRootNode : function() { | getRootNode : function() { | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | _ondrag : function(e) { | ||||
// Let other handlers deal with this event before we do. | // Let other handlers deal with this event before we do. | ||||
return; | return; | ||||
} | } | ||||
e.kill(); | e.kill(); | ||||
this._dragging = e.getNode(this._sigil); | this._dragging = e.getNode(this._sigil); | ||||
this._origin = JX.$V(e); | this._origin = JX.$V(e); | ||||
this._originScroll = JX.Vector.getAggregateScrollForNode(this._dragging); | |||||
this._dimensions = JX.$V(this._dragging); | this._dimensions = JX.$V(this._dragging); | ||||
for (var ii = 0; ii < this._group.length; ii++) { | for (var ii = 0; ii < this._group.length; ii++) { | ||||
this._group[ii]._clearTarget(); | this._group[ii]._clearTarget(); | ||||
this._group[ii]._generateTargets(); | this._group[ii]._generateTargets(); | ||||
} | } | ||||
if (!this.invoke('didBeginDrag', this._dragging).getPrevented()) { | if (!this.invoke('didBeginDrag', this._dragging).getPrevented()) { | ||||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | _onmove : function(e) { | ||||
group[ii]._clearTarget(); | group[ii]._clearTarget(); | ||||
} | } | ||||
} | } | ||||
// If the drop target indicator is above the cursor in the document, | // If the drop target indicator is above the cursor in the document, | ||||
// adjust the cursor position for the change in node document position. | // adjust the cursor position for the change in node document position. | ||||
// Do this before choosing a new target to avoid a flash of nonsense. | // Do this before choosing a new target to avoid a flash of nonsense. | ||||
var origin = this._origin; | var scroll = JX.Vector.getAggregateScrollForNode(this._dragging); | ||||
var origin = { | |||||
x: this._origin.x + (this._originScroll.x - scroll.x), | |||||
y: this._origin.y + (this._originScroll.y - scroll.y) | |||||
}; | |||||
var adjust_h = 0; | var adjust_h = 0; | ||||
var adjust_y = 0; | var adjust_y = 0; | ||||
if (this._target !== false) { | if (this._target !== false) { | ||||
var ghost = this.getGhostNode(); | var ghost = this.getGhostNode(); | ||||
adjust_h = JX.Vector.getDim(ghost).y; | adjust_h = JX.Vector.getDim(ghost).y; | ||||
adjust_y = JX.$V(ghost).y; | adjust_y = JX.$V(ghost).y; | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | _unlock : function() { | ||||
} | } | ||||
} | } | ||||
this._locked--; | this._locked--; | ||||
if (!this._locked) { | if (!this._locked) { | ||||
this.invoke('didUnlock'); | this.invoke('didUnlock'); | ||||
} | } | ||||
return this; | return this; | ||||
} | } | ||||
} | } | ||||
}); | }); |