[Proto-Scripty] Re: Scalable Drag Drop (without noticeable lag)

2010-11-15 Thread Scott
Eric,

Awesome suggestion thank you! I am now only observing the containers
and deciding what to do based on the event.findElement().

as far as the drag/drop goes, I am actually doing my own version. on
mousedown of the container, I am cloning the element returned by
event.findElement() and attaching it to the cursor (slightly offset so
that the cursor is not over the top of the clone) and then on mouseup
finding the new element and grabbing the info I need to complete the
'drop'.

same goes with observing click: I am only observing click on the
container.

Thanks again!


On Oct 19, 1:02 am, Eric lefauv...@gmail.com wrote:
 Hi Scott,

 I didn't do much with drag/drop using scripty, but can't you just have
 one droppable (in your case it would be $('cats')) and find out which
 span was under the mouse when a drop occurs?

 In the same spirit, instead of adding a onmouseover event on
 each .drag item, you may add one on your body (or on your two ULs if
 you prefer), and test if the event happened on one .drag element
 (something like if(elt=event.findElement('.drag')) ...).

 Last point: I don't know if it is possible, but did you try to create
 the draggable on the mousedown instead of the mouseover?
 It will save lots of work to the browser (It would require some
 tweaks, but I successfully used this technique with
 Ajax.InPlaceEditor).

 Eric

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Scalable Drag Drop (without noticeable lag)

2010-10-19 Thread Eric
Hi Scott,

I didn't do much with drag/drop using scripty, but can't you just have
one droppable (in your case it would be $('cats')) and find out which
span was under the mouse when a drop occurs?

In the same spirit, instead of adding a onmouseover event on
each .drag item, you may add one on your body (or on your two ULs if
you prefer), and test if the event happened on one .drag element
(something like if(elt=event.findElement('.drag')) ...).

Last point: I don't know if it is possible, but did you try to create
the draggable on the mousedown instead of the mouseover?
It will save lots of work to the browser (It would require some
tweaks, but I successfully used this technique with
Ajax.InPlaceEditor).

Eric

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Scalable Drag Drop (without noticeable lag)

2010-10-18 Thread Scott
 What I usually do is post it inline in the message (as you did), and
 *also* post it to Pastie.org and provide a link.

Thanks T.J.

Here's a url to my test code:
http://pastie.org/1230063

Anyone got any ideas / suggestions (/improvements on my code)?

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Scalable Drag Drop (without noticeable lag)

2010-10-17 Thread T.J. Crowder
Hi,

 Not much I can do about that i
 guess. just letting you know I didn't write it that way.

What I usually do is post it inline in the message (as you did), and
*also* post it to Pastie.org and provide a link. Pastie preserves the
formatting correctly. (I've never quite understood the truly bizarre
and arbitrary way Google adds linebreaks to code...)

FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Oct 15, 7:08 pm, Scott counterstre...@gmail.com wrote:
 When copying and pasting the html from my post, there are some extra
 line breaks or wrapping happening. Not much I can do about that i
 guess. just letting you know I didn't write it that way.

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Scalable Drag Drop (without noticeable lag)

2010-10-15 Thread Scott
When copying and pasting the html from my post, there are some extra
line breaks or wrapping happening. Not much I can do about that i
guess. just letting you know I didn't write it that way.

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.