Revision 3dc29e42
Von Sven Schöling vor fast 8 Jahren hinzugefügt
SL/Layout/ActionBar/Submit.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
use parent qw(SL::Layout::ActionBar::Action); |
5 | 5 |
|
6 |
use JSON; |
|
7 |
|
|
8 |
use Rose::Object::MakeMethods::Generic ( |
|
9 |
'scalar --get_set_init' => [ qw(text submit) ], |
|
10 |
); |
|
11 |
|
|
12 | 6 |
sub render { |
13 | 7 |
$_[0]->p->html_tag('div', $_[0]->text, |
14 | 8 |
id => $_[0]->id, |
... | ... | |
16 | 10 |
); |
17 | 11 |
} |
18 | 12 |
|
19 |
sub script { |
|
20 |
# store submit and form and stuff in data attribute |
|
21 |
sprintf q|$('#%s').data('action', %s);|, $_[0]->id, JSON::to_json({ |
|
22 |
submit => $_[0]->submit, |
|
23 |
}); |
|
24 |
} |
|
25 |
|
|
26 | 13 |
1; |
Auch abrufbar als: Unified diff
ActionBar: calling conventions geändert, +check/disabled/confirm