diff --git a/source/Ox.UI/js/List/List.js b/source/Ox.UI/js/List/List.js index b338e5d2..cc6b9627 100644 --- a/source/Ox.UI/js/List/List.js +++ b/source/Ox.UI/js/List/List.js @@ -244,15 +244,10 @@ Ox.List = function(options, self) { ] = selectNext; if (self.options.max == -1) { self.keyboardEvents[ - 'key_' + ( - self.options.orientation == 'vertical' - ? 'shift_up' : 'shift_left' - ) + 'key_shift_' + (self.options.orientation == 'vertical' ? 'up' : 'left') ] = addPreviousToSelection; self.keyboardEvents[ - 'key_' + ( - self.options.orientation == 'vertical' - ? 'shift_down' : 'shift_right' + 'key_shift_' + (self.options.orientation == 'vertical' ? 'down' : 'right' ) ] = addNextToSelection; } @@ -607,11 +602,7 @@ Ox.List = function(options, self) { function getNext() { var pos = -1; if (self.selected.length) { - pos = ( - self.options.orientation == 'both' - ? self.selected[0] - : Ox.max(self.selected) - ) + 1; + pos = self.selected[0] + 1; if (pos == self.$items.length) { pos = -1; } @@ -721,11 +712,7 @@ Ox.List = function(options, self) { function getPrevious() { var pos = -1; if (self.selected.length) { - pos = ( - self.options.orientation == 'both' - ? self.selected[0] - : Ox.min(self.selected) - ) - 1; + pos = self.selected[0] - 1; } return pos; } @@ -918,9 +905,12 @@ Ox.List = function(options, self) { deselect(pos); } } else if (data.shiftKey) { - if (self.options.max == -1) { - // shift-click on item + if (!isSelected(pos) && self.options.max == -1) { + // shift-click on unselected item addAllToSelection(pos); + } else if (isSelected(pos)) { + // shift-click on selected item + addToSelection(pos); } } else if (!isSelected(pos) && self.options.max != 0) { // click on unselected item