Page 1 of 1

"Range"-selection bugs in "Queue"

Posted: July 31st, 2014, 10:03 am
by Hurda
1.) I cannot get "Range" to work when selecting the first and i.e. fifth entry (setting the queue to show everything to demonstrate).
Either no checkboxes in between are being checked, or all the checkboxes from the fifth entry down to the penultimate entry are being checked.
Trying select a range from the second to fifth or third to fifth etc. is working fine, it's only not working only when the first entry is selected.

2.) After trying the above, click "None" to deselect all checkboxes, and then, without checking any boxes, click "Range". The penultimate checkbox will be checked, for whatever reason.

Tested in Firefox, IE and Chrome, sabnzdb.log comes up empty regarding this.

Can you confirm this?

Re: "Range"-selection bugs in "Queue"

Posted: August 2nd, 2014, 6:24 am
by shypike
Confirmed.
Strangely enough "Range" does work in the file details page of a job.
I will investigate.

Re: "Range"-selection bugs in "Queue"

Posted: August 2nd, 2014, 7:18 pm
by mrnejc
Just came here to report this issue as well ;D

The problem is in plush.js - testing last1 or last2 when their value is 0 evaluates to false.

This is quick and dirty fix - change (starting at line 753):

Code: Select all

    if (last1 && last2 && last1 < last2)
      $("INPUT[type='checkbox']","#queueTable").slice(last1,last2).prop('checked', true).trigger('change');
    else if (last1 && last2)
      $("INPUT[type='checkbox']","#queueTable").slice(last2,last1).prop('checked', true).trigger('change');
to

Code: Select all

    if ((last1||last1==0) && (last2||last2==0) && last1 < last2)
      $("INPUT[type='checkbox']","#queueTable").slice(last1,last2).prop('checked', true).trigger('change');
    else if ((last1||last1==0) && (last2||last2==0))
      $("INPUT[type='checkbox']","#queueTable").slice(last2,last1).prop('checked', true).trigger('change');
please note: I'm not a JavaScript dev so there must be a better/cleaner way to fix this ...

Re: "Range"-selection bugs in "Queue"

Posted: August 3rd, 2014, 2:28 pm
by shypike
Thanks, should make it easier to fix.

Re: "Range"-selection bugs in "Queue"

Posted: August 5th, 2014, 9:37 am
by Hurda
Thanks for confirming!

There's also a quirk in the file-details-page, but it's very minor.

Select any two files, then "range", then "none" and again "range".
I.e. when first checking the second and sixth checkbox, clicking range for the second time will select the checkboxes 3, 4, 5 and 6.