http://bugs.winehq.org/show_bug.cgi?id=35312
Bug ID: 35312 Summary: "Toggle All" currently means "Inverse Selection" Product: Wine-Testbot Version: unspecified Hardware: x86 OS: Linux Status: NEW Severity: enhancement Priority: P2 Component: unknown Assignee: wine-bugs@winehq.org Reporter: 00cpxxx@gmail.com Classification: Unclassified
When selecting VMs the button "Toggle All" actually inverses the current selection.
function ToggleAll() { for (var i = 0; i < document.forms[0].elements.length; i++) { if(document.forms[0].elements[i].type == 'checkbox') document.forms[0].elements[i].checked = !(document.forms[0].elements[i].checked); } }
A possible solution:
var toggledstate = true; function ToggleAll() { toggledstate = !toggledstate; for (var i = 0; i < document.forms[0].elements.length; i++) { if(document.forms[0].elements[i].type == 'checkbox') document.forms[0].elements[i].checked = toggledstate; } }
https://bugs.winehq.org/show_bug.cgi?id=35312
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fgouget@codeweavers.com
--- Comment #1 from François Gouget fgouget@codeweavers.com --- I'd argue that 'Toggle' means 'inverse the current state'. So toggling a switch does not mean turning it on but setting it to the other position, which may either be on or off.
But then I may agree with you that 'toggle' is not necessarily what we want here. It may make more sense to have something that checks everything if one box was unchecked, and otherwise unchecks everything. I believe that's how gmail's global selection checkbox works for instance.
Finally, regarding the proposed code I don't think using a global variable is a good idea. Fortunately it should not be needed.
https://bugs.winehq.org/show_bug.cgi?id=35312
--- Comment #2 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to François Gouget from comment #1)
I'd argue that 'Toggle' means 'inverse the current state'. So toggling a switch does not mean turning it on but setting it to the other position, which may either be on or off.
I understand that now, thanks for the explanation.
But then I may agree with you that 'toggle' is not necessarily what we want here. It may make more sense to have something that checks everything if one box was unchecked, and otherwise unchecks everything. I believe that's how gmail's global selection checkbox works for instance.
Yes, that would be nice.
Finally, regarding the proposed code I don't think using a global variable is a good idea. Fortunately it should not be needed.
Hehe, just a hack to "solve" the original problem.
https://bugs.winehq.org/show_bug.cgi?id=35312
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #3 from François Gouget fgouget@codeweavers.com --- The Submit Job page now uses a normal "Select All" toggle:
commit 0ad777fa1db816a0f74663c94d9fa969218ac859 Author: Francois Gouget fgouget@codeweavers.com Date: Wed Oct 2 06:56:23 2019 +0200
testbot/Submit: Add a single page mode.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org