Skip to content

Commit

Permalink
the head option can now be a coderef
Browse files Browse the repository at this point in the history
  • Loading branch information
lstein committed Jun 17, 2009
1 parent 7b3ac2a commit 437c898
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Bio/Graphics/Browser/Render/HTML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ sub render_error_div {
);
}

sub render_user_head {
my $self = shift;
my $settings = $self->state;
return '' unless $settings->{head};
my $a = $self->data_source->global_setting('head');
return $a->(@_) if ref $a eq 'CODE';
return $a || '';
}

sub render_user_header {
my $self = shift;
my $settings = $self->state;
Expand Down Expand Up @@ -284,7 +293,8 @@ sub render_html_head {
$set_dragcolors = "set_dragcolors('$fill')";
}

push @extra_headers,$self->setting('head') if $self->setting('head');
my $extra_headers = $self->render_user_head;
push @extra_headers,$extra_headers if $extra_headers;

# put them all together
my @args = (-title => $title,
Expand Down

0 comments on commit 437c898

Please sign in to comment.