mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-29 12:49:06 +02:00
6e74b57c36
BUG Make SelectionGroup.ss and SelectionGroup.js work together BUG Fix for IE visual indentation of composite field
23 lines
549 B
JavaScript
23 lines
549 B
JavaScript
import $ from '../jQuery';
|
|
|
|
$(document).ready(function() {
|
|
// Support both bootstrap / legacy selectors
|
|
$('ul.SelectionGroup input.selector, ul.selection-group 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();
|
|
}
|
|
);
|
|
});
|