1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/en/_static/configurationblock.js
2010-12-16 21:59:27 +01:00

35 lines
1.2 KiB
JavaScript

$(document).ready(function(){
$('div.configuration-block [class^=highlight-]').hide();
$('div.configuration-block [class^=highlight-]').width($('div.configuration-block').width());
$('div.configuration-block').addClass('jsactive');
$('div.configuration-block').addClass('clearfix');
$('div.configuration-block').each(function (){
var el = $('[class^=highlight-]:first', $(this));
el.show();
el.parents('ul').height(el.height() + 40);
});
// Global
$('div.configuration-block li').each(function(){
var str = $(':first', $(this)).html();
$(':first ', $(this)).html('');
$(':first ', $(this)).append('<a href="#">' + str + '</a>')
$(':first', $(this)).bind('click', function(){
$('[class^=highlight-]', $(this).parents('ul')).hide();
$('li', $(this).parents('ul')).removeClass('selected');
$(this).parent().addClass('selected');
var block = $('[class^=highlight-]', $(this).parent('li'));
block.show();
block.parents('ul').height(block.height() + 40);
return false;
});
});
$('div.configuration-block').each(function (){
$('li:first', $(this)).addClass('selected');
});
});