[Proto-Scripty] Re: Sortable.create and onHover
On Aug 10, 9:57 am, Sebastien wrote: > Ok, thanks, but how would you implement my code then? > Do I have to overload the whole Sortable.onHover method? > If yes, then every new Sortable created will call the onHover method > isn't it? I would like it to be called only for this Sortable, not all > of them. > You write your own 'onHover' function and pass it as the 'onHover' argument to the Sortable. --~--~-~--~~~---~--~~ 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-scriptaculous@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: Sortable.create and onHover
Ok, thanks, but how would you implement my code then? Do I have to overload the whole Sortable.onHover method? If yes, then every new Sortable created will call the onHover method isn't it? I would like it to be called only for this Sortable, not all of them. Thanks for your help, Seb On Aug 9, 8:17 pm, mr_justin wrote: > > what I want to do is pass the onHover to the created > > Droppables. > > But it already does that. See dragdrop.js for this code in the > Sortable#create method: > > // build options for the droppables > var options_for_droppable = { > overlap: options.overlap, > containment: options.containment, > tree: options.tree, > hoverclass: options.hoverclass, > onHover: Sortable.onHover // <-- Here is where it > happens > }; --~--~-~--~~~---~--~~ 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-scriptaculous@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: Sortable.create and onHover
> what I want to do is pass the onHover to the created > Droppables. But it already does that. See dragdrop.js for this code in the Sortable#create method: // build options for the droppables var options_for_droppable = { overlap: options.overlap, containment: options.containment, tree:options.tree, hoverclass: options.hoverclass, onHover: Sortable.onHover // <-- Here is where it happens }; --~--~-~--~~~---~--~~ 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-scriptaculous@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: Sortable.create and onHover
No, I don't need onMouseOver... What I want to do is that when a certain element hovers over one of my Sortable, that Sortable expands (changes class essentially). I understand that Sortable implement Draggables and Droppables under the cover, what I want to do is pass the onHover to the created Droppables. The code I was playing with looks like: Sortable.create(itemID, { tag: 'div', dropOnEmpty: true, containment: ["container1", "container2"], constraint: false, only: ['type1', 'type2'], scroll: window, onHover: function(element, itemNb){ onHover_innerContactOverContact(element, itemNb); } } ); Thanks for your help. Seb On Aug 7, 4:22 pm, mr_justin wrote: > What exactly are you trying to do with that callback? Let's see some > code. > > Sortable just implements Draggables and Droppables for you under the > covers, and the onHover callback you pass to Sortable is just passed > on through to the Droppable constructor. > > You know the onHover is for when your Draggable is hovering over a > Droppable, right? I mean it's not for when you hover over a sortable > object or anything like that. > > -justin --~--~-~--~~~---~--~~ 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-scriptaculous@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: Sortable.create and onHover
What exactly are you trying to do with that callback? Let's see some code. Sortable just implements Draggables and Droppables for you under the covers, and the onHover callback you pass to Sortable is just passed on through to the Droppable constructor. You know the onHover is for when your Draggable is hovering over a Droppable, right? I mean it's not for when you hover over a sortable object or anything like that. -justin --~--~-~--~~~---~--~~ 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-scriptaculous@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: Sortable.create and onHover
is it not "onmouseover" ? Never knew there was an "onHover" Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "Sebastien" To: "Prototype & script.aculo.us" Sent: Friday, August 07, 2009 11:24 AM Subject: [Proto-Scripty] Sortable.create and onHover > > Hi All, > > I need to capture the onHover event for on a Sortable element. > The onHover callback does not work (as far as I tested) for Sortable > element, is there a way around this? I can of course make the element > also a Droppable, in which case I can work around this restriction, > but it is particularly heavy I guess. > > Any thoughts? > > Thanks, > > Seb > > > > --~--~-~--~~~---~--~~ 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-scriptaculous@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 -~--~~~~--~~--~--~---