[pLog-svn] r3457 - plog/trunk/js/ui

Oscar Renalias oscar at renalias.net
Wed May 24 11:56:24 GMT 2006


Try this:

1) undo my change
2) edit one blog
3) in the list at the bottom of the page, add 3 users
4) select them all and try to remove them

You should get one left, even though you wanted to remove them all.

Now put my change by back and try again, all users should be gone now.

I was at least able to reproduce this behaviour.

Oscar

On 5/24/06, Jon Daley <plogworld at jon.limedaley.com> wrote:
>         Why did you remove the length field?  Was it not working for you?
> try printing out 'userList.options.length' each time through the loop.
> And I think you will see that it is decremented when an item is set to
> null.  Not decrementing length will not break anything, but it will loop
> through non-existent items.
>
> On Wed, 24 May 2006, oscar at devel.lifetype.net wrote:
>
> > Author: oscar
> > Date: 2006-05-24 08:25:33 +0000 (Wed, 24 May 2006)
> > New Revision: 3457
> >
> > Modified:
> >   plog/trunk/js/ui/common.js
> > Log:
> > This fix was introduced in revision r3441 but it broke removing multiple users because it always left the last one behind (it removed everything else except the last one)
> > Jon, since you made the original fix, can you check if this breaks it again?
> >
> >
> > Modified: plog/trunk/js/ui/common.js
> > ===================================================================
> > --- plog/trunk/js/ui/common.js        2006-05-24 08:06:21 UTC (rev 3456)
> > +++ plog/trunk/js/ui/common.js        2006-05-24 08:25:33 UTC (rev 3457)
> > @@ -435,7 +435,8 @@
> >       for( i = 0; i < length; i++ ) {
> >               if( userList.options[i].selected ){
> >                       userList.options[i] = null;
> > -            i--; length--;
> > +            i--;
> > +            //length--;
> >         }
> >       }
> >       return( true );
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://devel.lifetype.net/mailman/listinfo/plog-svn
> >
>
> **************************************
> Jon Daley
> http://jon.limedaley.com/
>
> Any tool, when dropped, will roll into the least accessible corner.
> -- Anthony's Law of the Workshop
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>


More information about the pLog-svn mailing list