silverstripe-framework/javascript/SelectionGroup.js
Ingo Schommer 548ad503ed API Removed keyed arrays for title/value setting in SelectionGroup
Use SelectionGroup_Item class instead. Necessary because
of removal of array key support from ArrayList (see d12b49702).
2012-12-11 11:06:06 +01:00

15 lines
400 B
JavaScript

(function($) {
$(document).ready(function() {
$('ul.SelectionGroup input.selector').live('click', function() {
var li = $(this).closest('li');
li.addClass('selected');
var prev = li.prevAll('li.selected');
if(prev.length) prev.removeClass('selected');
var next = li.nextAll('li.selected');
if(next.length) next.removeClass('selected');
$(this).focus();
});
})
})(jQuery);