silverstripe-framework/javascript/SelectionGroup.js

16 lines
396 B
JavaScript
Raw Normal View History

(function($) {
$(document).ready(function() {
$('ul.SelectionGroup input.selector').livequery('click', function(){
var li = $(this).parent('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);