(cross posted from the newly started scriptaculous group) Alright, seems like a simple enough problem, and I''m not even sure if it''s my plain lack of knowledge that makes me ask it. Anyway. So I know that you can apply horizontal and vertical constraints for a draggable in scriptaculous. Question is, can I also put a region constraint onto it? That''s to say, can I make sure that the draggable object stays within the rectangle described by, say, a rectangle (x,y, width, height)? My current workaround is to have an invisible div (let''s call this B) positioned exactly over the object I actually want to drag (call it A), make B draggable, and then change the top and left parameters of the A according to whatever rules I put it (ie - move only if B is within (x,y, width, height) ) But that''s kinda... cheating, no?. So yeah, anyone got a better idea? Or is there already a way of giving region constraints? Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-26 09:02 UTC
Re: Is a Draggable region constraint possible?
Hey there, Pi a écrit :> (cross posted from the newly started scriptaculous group)Ah. I''m not too sure two groups about Prototype/s.a.us is a good thing: it will dilute the effort.> So I know that you can apply horizontal and vertical constraints for a > draggable in scriptaculous. Question is, can I also put a region > constraint onto it? That''s to say, can I make sure that the draggable > object stays within the rectangle described by, say, a rectangle (x,y, > width, height)?Write your own ''snap'' callback function. Since it can round coordinates to make the move "stick to grid", it can also apply any constraints you''d like. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
> Pi a écrit : >> (cross posted from the newly started scriptaculous group) > > Ah. I''m not too sure two groups about Prototype/s.a.us is a good > thing: > it will dilute the effort.Agreed. What new group?>> So I know that you can apply horizontal and vertical constraints >> for a >> draggable in scriptaculous. Question is, can I also put a region >> constraint onto it? That''s to say, can I make sure that the draggable >> object stays within the rectangle described by, say, a rectangle >> (x,y, >> width, height)? > > Write your own ''snap'' callback function. Since it can round > coordinates > to make the move "stick to grid", it can also apply any constraints > you''d like.There''s a good example of this in the repository: scriptaculous/test/ functional/dragdrop6_test.html TAG --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Am 26.10.2006 um 20:12 schrieb Tom Gregory:> >> Pi a écrit : >>> (cross posted from the newly started scriptaculous group) >> >> Ah. I''m not too sure two groups about Prototype/s.a.us is a good >> thing: >> it will dilute the effort. > > Agreed. What new group? >I''d like to know, too.... -Thomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
I found this just by trying: http://groups.google.com/group/scriptaculous I don''t think we need another group/ML, do we? On 10/28/06, Thomas Fuchs <t.fuchs-moWQItti3gBl57MIdRCFDg@public.gmane.org> wrote:> > > Am 26.10.2006 um 20:12 schrieb Tom Gregory: > > > > >> Pi a écrit : > >>> (cross posted from the newly started scriptaculous group) > >> > >> Ah. I''m not too sure two groups about Prototype/s.a.us is a good > >> thing: > >> it will dilute the effort. > > > > Agreed. What new group? > > > > I''d like to know, too.... > > -Thomas > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-30 09:57 UTC
Re: Is a Draggable region constraint possible?
Hey Martin, Martin Ström a écrit :> I found this just by trying: http://groups.google.com/group/scriptaculousHmm, yes. 32 members, 11 messages over 6 months, only 1 message actually got replies. I tried subscribing and leaving an announcement about this group (and the Talk group, incidently), but I don''t see it appearing just yet, much like what happened to me on my early posts in *this* group. I''ll try again later, including in replies to recent posts, if this keeps shunning me off. People who need help will indeed try "scriptaculous" first, when the help actually is here, not there. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Thanks Christophe. I tried it, and it works great! [except for a few bugs I''m sure are mine, but that''s unrelated :P] And yeah, I found that "other" group by googling google groups for "scriptaculous". Sorry, didn''t mean to offend anybody. PS- What other rubyonrails spinoffs are there, besides prototype and s.a.us? Curious. On Oct 26, 2:02 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey there, > > Pi a écrit : > > > (cross posted from the newly started scriptaculous group)Ah. I''m not too sure two groups about Prototype/s.a.us is a good thing: > it will dilute the effort. > > > So I know that you can apply horizontal and vertical constraints for a > > draggable in scriptaculous. Question is, can I also put a region > > constraint onto it? That''s to say, can I make sure that the draggable > > object stays within the rectangle described by, say, a rectangle (x,y, > > width, height)?Write your own ''snap'' callback function. Since it can round coordinates > to make the move "stick to grid", it can also apply any constraints > you''d like. > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Hi Christophe, I looked at the other group this morning and your message was there. Jim -----Original Message----- From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-spinoffs@googlegroups.com] On Behalf Of Christophe Porteneuve Sent: Monday, October 30, 2006 4:57 AM To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails-spinoffs] Re: Is a Draggable region constraint possible? Hey Martin, Martin Ström a écrit :> I found this just by trying: http://groups.google.com/group/scriptaculousHmm, yes. 32 members, 11 messages over 6 months, only 1 message actually got replies. I tried subscribing and leaving an announcement about this group (and the Talk group, incidently), but I don''t see it appearing just yet, much like what happened to me on my early posts in *this* group. I''ll try again later, including in replies to recent posts, if this keeps shunning me off. People who need help will indeed try "scriptaculous" first, when the help actually is here, not there. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
On 10/30/06, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> I tried subscribing and leaving an announcement > about this groupThere is also a group named prototype.js --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-31 07:16 UTC
Re: Is a Draggable region constraint possible?
Martin Bialasinski a écrit :> On 10/30/06, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > >> I tried subscribing and leaving an announcement >> about this group > > There is also a group named prototype.jsOh my! It''s a tad more active than the "scriptaculous" one, but I posted the same kind of entry there. Thanks for bringing this to notice. -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---