this.draggable = new Draggable($("someElement"), dragOptions);
this.draggableObserver = {
onStart: function(eventName, draggable, event) {
if (draggable == this.draggable) {
doSomething();
}
}.bind(this),
onDrag: function(eventName, draggable, event) {
if (draggable == this.moveable) {
doSomething();
}
}.bind(this),
onEnd: function(eventName, draggable, event) {
if (draggable == this.moveable) {
doSomething();
}
}.bind(this)
}
Draggables.addObserver(this.draggableObserver);
The onDrag event seems to be the important one for you, and it does fire after scriptaculous updates the position, so you can then change the position yourself in that function to what you want. This may produce odd results but could point you in the right direction.
But, you could always just override the updateDrag or the draw method for your Draggable instances (for the next bit I'm assuming you already have a Draggable called myDraggable)...
myDraggable.updateDrag = function(event, pointer) {
//insert custom code, copying what you need from dragdrop.js
};myDraggable.draw = function(point) {
//insert custom code, copying what you need from
dragdrop.js
};On 6/14/06, Jeremy Kitchen <[EMAIL PROTECTED]> wrote:
On Wednesday 14 June 2006 16:44, Tom Gregory wrote:
> I've been in a rut today, so perhaps I misinterpreted what you're
> looking for:
>
> As I understood your question, you wanted to be able to use the drag/
> drop functionality that comes with scriptaculous, but define your own
> default behaviors for onDragStart, onDrag, on DragFinish, and
> onUpdate. If this is what you want, then an observer is the way to
> go. The Sortables class adds functionality to the basic drag/drop in
> this way.
no, because I need to handle the positioning of the object I'm dragging
myself. And SortableObserver appears to be an observer for Sortables, where
I'm working with Draggables :)
-Jeremy
--
Jeremy Kitchen ++ [EMAIL PROTECTED]
http://www.pirate-party.us/ -- defend your rights
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
