Revision 4061ebb7
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
SL/Controller/Layout/Base.pm | ||
---|---|---|
5 | 5 |
|
6 | 6 |
use Rose::Object::MakeMethods::Generic ( |
7 | 7 |
'scalar --get_set_init' => qw(menu), |
8 |
'scalar' => qw(focus), |
|
8 | 9 |
'array' => [ |
9 | 10 |
'add_stylesheets_inline' => { interface => 'add', hash_key => 'stylesheets_inline' }, |
10 | 11 |
'add_javascripts_inline' => { interface => 'add', hash_key => 'javascripts_inline' }, |
SL/Controller/Layout/None.pm | ||
---|---|---|
4 | 4 |
use parent qw(SL::Controller::Layout::Base); |
5 | 5 |
|
6 | 6 |
sub javascripts_inline { |
7 |
_setup_formats(), |
|
8 |
_setup_focus(), |
|
9 |
} |
|
10 |
|
|
11 |
|
|
12 |
sub _setup_formats { |
|
7 | 13 |
$::form->parse_html_template('generic/javascript_setup') |
8 | 14 |
} |
9 | 15 |
|
16 |
sub _setup_focus { |
|
17 |
if ($::request->{layout}->focus || $::form->{fokus}) { |
|
18 |
return $::form->parse_html_template('generic/focus_setup', { |
|
19 |
focus => $::request->{layout}->focus, |
|
20 |
fokus => $::form->{fokus}, |
|
21 |
}) |
|
22 |
} else { |
|
23 |
return (); |
|
24 |
} |
|
25 |
} |
|
26 |
|
|
10 | 27 |
1; |
SL/Form.pm | ||
---|---|---|
488 | 488 |
push @header, map { qq|<script type="text/javascript" src="$_"></script>| } $layout->javascripts; |
489 | 489 |
push @header, $self->{javascript} if $self->{javascript}; |
490 | 490 |
push @header, map { $_->show_javascript } @{ $self->{AJAX} || [] }; |
491 |
push @header, "<script type='text/javascript'>function fokus(){ document.$self->{fokus}.focus(); }</script>" if $self->{fokus}; |
|
492 | 491 |
|
493 | 492 |
my %doctypes = ( |
494 | 493 |
strict => qq|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">|, |
templates/webpages/generic/focus_setup.html | ||
---|---|---|
1 |
function fokus(){ [% IF focus %]$('[% focus %]').focus()[% ELSE %][% fokus %].focus()[% END %] } |
Auch abrufbar als: Unified diff
container für focus handling