elduderino
2008-May-02 22:33 UTC
making an element draggable after it''s been dropped in a drop zone
Hi, I have this code which allows me to drop a draggable item in to a droppable zone. It works fine but what i want to happen is once the item ( droppable) has been dropped in to the drop zone (dropp) for the item to be draggable again. At the moment once ive dropped the item in the drop zone i can''t make it draggable again.....even if i repeat this line: new Draggable(''draggable'', { revert: true}); in the function after i''ve added some css styles... document.observe(''dom:loaded'', function() { new Draggable(''draggable'', { revert: true}); Droppables.add(''dropp'', { accept: ''accept'', hoverclass: ''dropallowed'', onDrop : function(obj){ obj.setStyle(''width: 100px; height: 100px; background: blue;''); } any ideas? Thanks --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Tom Gregory
2008-May-03 04:27 UTC
Re: making an element draggable after it''s been dropped in a drop zone
You shouldn''t have to call "new Draggable" again... based on what you''re describing, I''m a bit surprised that you have "revert:true" set. TAG On May 2, 2008, at 4:33 PM, elduderino wrote:> > Hi, > > I have this code which allows me to drop a draggable item in to a > droppable zone. It works fine but what i want to happen is once the > item ( droppable) has been dropped in to the drop zone (dropp) for the > item to be draggable again. At the moment once ive dropped the item in > the drop zone i can''t make it draggable again.....even if i repeat > this line: > new Draggable(''draggable'', { revert: true}); in the function after > i''ve added some css styles... > > document.observe(''dom:loaded'', function() { > new Draggable(''draggable'', { revert: true}); > Droppables.add(''dropp'', { accept: ''accept'', hoverclass: > ''dropallowed'', onDrop : function(obj){ > obj.setStyle(''width: 100px; height: 100px; background: blue;''); > > > > } > > > any ideas? > > Thanks > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
elduderino
2008-May-03 17:09 UTC
Re: making an element draggable after it''s been dropped in a drop zone
Well as i say once i''ve dropped it the dragging functionality ceases to work. I''m not too sure if thats what should happen or if its the way my code is written. On May 3, 5:27 am, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote:> You shouldn''t have to call "new Draggable" again... based on what > you''re describing, I''m a bit surprised that you have "revert:true" set. > > TAG > > On May 2, 2008, at 4:33 PM, elduderino wrote: > > > > > Hi, > > > I have this code which allows me to drop a draggable item in to a > > droppable zone. It works fine but what i want to happen is once the > > item ( droppable) has been dropped in to the drop zone (dropp) for the > > item to be draggable again. At the moment once ive dropped the item in > > the drop zone i can''t make it draggable again.....even if i repeat > > this line: > > new Draggable(''draggable'', { revert: true}); in the function after > > i''ve added some css styles... > > > document.observe(''dom:loaded'', function() { > > new Draggable(''draggable'', { revert: true}); > > Droppables.add(''dropp'', { accept: ''accept'', hoverclass: > > ''dropallowed'', onDrop : function(obj){ > > obj.setStyle(''width: 100px; height: 100px; background: blue;''); > > > } > > > any ideas? > > > Thanks--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---