Skip to content

Commit

Permalink
check element exist
Browse files Browse the repository at this point in the history
  • Loading branch information
weijen committed Mar 17, 2010
1 parent f7b74ee commit e4a5684
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions app/views/groups/show.html.erb
Expand Up @@ -31,26 +31,29 @@
<script type="text/javascript">
var option = {dateFormat: 'yy-mm-dd'};
$(function(){
$('#start-date').datepicker(option);
$('#end-date').datepicker(option);
$("a","#submenu").button();

$("a","#submenu").button();
$("#tabs").tabs({
ajaxOptions: {
error: function(xhr, status, index, anchor) {
$(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible.");
}
}
});

$('#start-date').datepicker(option);
$('#end-date').datepicker(option);

if($('#freeze_date_link').length != 0){
var freeze_date_link_pos = $('#freeze_date_link').position();
$('#froze_before_date_div').css({top: freeze_date_link_pos.top + 8,
left: freeze_date_link_pos.left + 110});
$('#freeze_date_link').click(function(){
$('#froze_before_date_div').toggle();
});
$('#froze_before_date').datepicker(option);

$("#tabs").tabs({
ajaxOptions: {
error: function(xhr, status, index, anchor) {
$(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible.");
}
}
});
}

});
</script>
<% end -%>

0 comments on commit e4a5684

Please sign in to comment.