Odd.. grabbed beta3, overwrote, added the if statement... all fixed.
I'll try in my actual application now.

Gareth


On 6/13/07, Gareth Evans <[EMAIL PROTECTED]> wrote:
>
> Hey man
>
> That was a good idea, I guess it fixed your prob but it doesnt seem to
> have fixed mine
>
> Check it out
> http://202.49.89.140/SortableExample.html
>
> There's a if (child==null) { } around the 3 lines you suggested.
>
> I'll try applying the aforementioned patch.
>
> Gareth
>
>
>  On 6/13/07, junkmate <[EMAIL PROTECTED]> wrote:
> >
> >
> > in fact, you dont need to do all that. The answer relates EXACTLY to
> > what you said my man, with the two things fighting each other...
> > The only thing you need to add is some if child==null brackets around
> > the end of the onEmptyHover function:
> >
> >        dropon.insertBefore(element, child);
> >        Sortable.options(oldParentNode).onChange(element);
> >        droponOptions.onChange(element);
> >
> > CHANGE ABOVE TO BELOW:
> >
> > if (child == null) {
> >        dropon.insertBefore(element, child);
> >        Sortable.options(oldParentNode).onChange(element);
> >        droponOptions.onChange (element);
> > }
> >
> >
> >
> > On Jun 13, 1:49 am, junkmate <[EMAIL PROTECTED]> wrote:
> > > FIXED:http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thr.
> > ..
> > >
> > > Make the few suggested changes there and all works fine for me!
> > >
> > > On Jun 13, 1:29 am, junkmate < [EMAIL PROTECTED]> wrote:
> > >
> > > > hmmm. definately does.
> > >
> > > > its annoying as every time i think ive fixed it by getting the
> > > > flickering to stop, it turns out that my modifications have simlply
> > > > disabled the dropOnEmpty functionality of the function :( Will keep
> > > > plodding on till I get there! Keep up the good work.
> > >
> > > > On Jun 13, 1:20 am, "Gareth Evans" < [EMAIL PROTECTED]> wrote:
> > >
> > > > > And a bit of evidence
> > > > > I added insertions to the onEmptyHover and onHover internal
> > functions to
> > > > > identify when they were being called.
> > > > > I assigned an 'index' attribute to every item in the dom...
> > > > > Then found all the insertBefore's and got it to spit out the
> > index... this
> > > > > is the output
> > >
> > > > > onEmptyHover Insertion @ 8
> > > > > onHover
> > > > > onHover
> > > > > onHover
> > > > > onHover
> > > > > onHover
> > > > > onHover Insertion @ 7
> > > > > onEmptyHover
> > > > > onEmptyHover Insertion @ 8
> > > > > onHover
> > > > > onHover Insertion @ 7
> > > > > onEmptyHover
> > > > > onEmptyHover Insertion @ 7
> > >
> > > > > Looks like this is on the right track, agree?
> > >
> > > > > Gareth
> > >
> > > > > On 6/13/07, Gareth Evans <[EMAIL PROTECTED]> wrote:
> > >
> > > > > > As far as I can tell,
> > > > > > In Create, it does some stuff that when dropOnEmpty is true, it
> > uses
> > > > > > options_for_tree to create a droppable.
> > > > > > This defines the onHover handler to be onEmptyHover.
> > > > > > The default onHover handler is just onHover.
> > >
> > > > > > Oohh here's something interesting.
> > >
> > > > > > I added an insertion for debug to both onHover and onEmptyHover
> > and *both*
> > > > > > are firing when it jitters.
> > >
> > > > > > If one was calculating the location to be above, and the other
> > below,
> > > > > > under a certain condition- wouldn't this cause the effect we
> > saw, as they'd
> > > > > > fire sequentially, one would move it up, the other would move it
> > down...
> > >
> > > > > > Gareth
> > >
> > > > > > On 6/13/07, junkmate <[EMAIL PROTECTED]> wrote:
> > >
> > > > > > > yup I tracked it down to there too. I cant find the "onHover
> > function
> > > > > > > when dropOnEmpty" is false though, so im unable to compare.
> > >
> > > > > > > ps. I find it interesting that this demo works completely
> > fine:
> > > > > > >
> > http://wiki.script.aculo.us/scriptaculous/page/print/SortableFloatsDemo
> > >
> > > > > > > On Jun 13, 12:05 am, "Gareth Evans" < [EMAIL PROTECTED]> wrote:
> > > > > > > > Yeah looks like the same bug to me, though much more
> > accentuated on
> > > > > > > yours.
> > > > > > > > In dragdrop.js these lines appear to be responsible
> > >
> > > > > > > > You can see i've added some debug insertions.
> > > > > > > > What appears to happen is that as i move the item up, one
> > pixel at at
> > > > > > > time,
> > > > > > > > it sometimes goes into the top branch, and occasionally into
> > the
> > > > > > > middle
> > > > > > > > branch.
> > >
> > > > > > > > This code reads *completely* differently to the onHover
> > function used
> > > > > > > when
> > > > > > > > dropOnEmpty:false.
> > >
> > > > > > > >       if(children) {
> > > > > > > >         var offset = Element.offsetSize(dropon,
> > droponOptions.overlap)
> > > > > > > * (
> > > > > > > > 1.0 - overlap);
> > >
> > > > > > > >         for (index = 0; index < children.length; index += 1)
> > {
> > > > > > > >           if (offset - Element.offsetSize (children[index],
> > > > > > > > droponOptions.overlap ) >= 0) {
> > > > > > > >             offset -= Element.offsetSize (children[index],
> > > > > > > > droponOptions.overlap);
> > > > > > > >      new Insertion.Top('debug','topbranch<br/>')
> > > > > > > >           } else if (offset - ( 
> > > > > > > > Element.offsetSize(children[index],
> > > > > > > > droponOptions.overlap) / 2) >= 0) {
> > > > > > > >             child = index + 1 < children.length ?
> > children[index + 1]
> > > > > > > :
> > > > > > > > null;
> > > > > > > >      new Insertion.Top('debug','midbranch<br/>')
> > > > > > > >             break;
> > > > > > > >           } else {
> > > > > > > >             child = children[index];
> > > > > > > >      new Insertion.Top('debug','bottombranch<br/>')
> > > > > > > >             break;
> > > > > > > >           }
> > > > > > > >         }
> > > > > > > >       }
> > >
> > > > > > > > I confess i'm not even sure what it's doing... at this
> > point.
> > >
> > > > > > > > Gareth
> > >
> > > > > > > > On 6/13/07, junkmate < [EMAIL PROTECTED]> wrote:
> > >
> > > > > > > > > Heres my test page:http://www.oldsushi.com/testing.php
> > >
> > > > > > > > > Going there make your browser small enough so the images
> > are on two
> > > > > > > > > lines, and you will see the problem when dragging around
> > the second
> > > > > > > > > line and below.
> > >
> > > > > > > > > On Jun 12, 11:10 pm, "Gareth Evans" <[EMAIL PROTECTED] >
> > wrote:
> > > > > > > > > > My problem, while related to dropOnEmpty as well seems
> > to only
> > > > > > > occur
> > > > > > > > > when my
> > > > > > > > > > sortables are nested, which is why I can't replicate it
> > on my test
> > > > > > > page.
> > > > > > > > > > I've been meaning to update my test page to prove it so
> > I have a
> > > > > > > clean
> > > > > > > > > page
> > > > > > > > > > to debug from within, that I can post up (it's really
> > hard to post
> > > > > > > up an
> > > > > > > > > > internal [read:burried] page of a web application.
> > > > > > > > > > I think there might be issues in the dropOnEmpty code.
> > >
> > > > > > > > > > Perhaps we should team up to debug the solution at some
> > point,
> > > > > > > > > > What Instant Messaging tools do you use?
> > >
> > > > > > > > > > On 6/13/07, junkmate < [EMAIL PROTECTED]> wrote:
> > >
> > > > > > > > > > > any update on this? I am having exactly the same
> > problem.
> > >
> > > > > > > > > > > I have two Div containers, one on top of the other,
> > where you
> > > > > > > can drag
> > > > > > > > > > > from on to the other.
> > > > > > > > > > > Each div is large enough for 5 images to fit on one
> > line.
> > >
> > > > > > > > > > > With less than 5 images, dragging and dropping is a
> > pleasure,
> > > > > > > with
> > > > > > > > > > > everything looking great. However above 5 images in
> > one
> > > > > > > container
> > > > > > > > > > > forces the images on to two rows, and then dragging
> > problems
> > > > > > > start.
> > > > > > > > > > > The top row is still perfectly fine, but the second
> > row and
> > > > > > > below it
> > > > > > > > > > > is very difficult to drag your image where you want it
> > to land,
> > > > > > > due to
> > > > > > > > > > > constantly alternating drop positions every pixel you
> > move...
> > >
> > > > > > > > > > > This problem only occurs with dropOnEmpty set to true,
> > yet I
> > > > > > > must have
> > > > > > > > > > > the ability to empty these lists.
> > >
> > > > > > > > > > > help :D
> >
> >
> > > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to