Commit c8be011a authored by Andrew Smith's avatar Andrew Smith Committed by Felix Schäfer

Correct major logic issues when selecting multiple rows.

The rows were being incorrectly selected (because the class name had a
missing '.').

jQuery items can't be directly compared to each other so we need to get
the HTML element to test if they are the same.
parent 8ab42473
......@@ -69,18 +69,17 @@
if (lastSelected !== null)
{
var toggling = false;
var rows = $(selectorName);
for (i = 0; i < rows.length; i++)
{
if (toggling || rows[i] == tr)
{
methods.addSelection(rows[i]);
var rows = $('.' + selectorName);
rows.each(function() {
var self = $(this);
if(toggling || (self.get(0) == tr.get(0))) {
methods.addSelection(self);
}
if (rows[i] == tr || rows[i] == lastSelected)
{
if(((self.get(0) == tr.get(0)) || (self.get(0) == lastSelected.get(0)))
&& (tr.get(0) !== lastSelected.get(0))) {
toggling = !toggling;
}
}
});
} else {
methods.addSelection(tr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment