diff options
author | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-09-03 03:42:08 +0000 |
---|---|---|
committer | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-09-03 03:42:08 +0000 |
commit | 049d22341026ead65b36eca2bddac7181f246142 (patch) | |
tree | 1b1ddb4668f74d0521b880f9d9347b5b3fa0d695 /lib/Reaction | |
parent | 3cb77ac087d9d0559649ba810be2bd26d97dee40 (diff) | |
download | reaction-049d22341026ead65b36eca2bddac7181f246142.tar.gz reaction-049d22341026ead65b36eca2bddac7181f246142.zip |
moved handle for image buttons to UI::Window
Diffstat (limited to 'lib/Reaction')
-rw-r--r-- | lib/Reaction/UI/ViewPort/Action.pm | 15 | ||||
-rw-r--r-- | lib/Reaction/UI/Window.pm | 9 |
2 files changed, 8 insertions, 16 deletions
diff --git a/lib/Reaction/UI/ViewPort/Action.pm b/lib/Reaction/UI/ViewPort/Action.pm index 480ab67..40fd709 100644 --- a/lib/Reaction/UI/ViewPort/Action.pm +++ b/lib/Reaction/UI/ViewPort/Action.pm @@ -11,8 +11,6 @@ use namespace::clean -except => [ qw(meta) ]; extends 'Reaction::UI::ViewPort::Object::Mutable'; with 'Reaction::UI::ViewPort::Action::Role::OK'; -sub DEBUG_EVENTS () { $ENV{REACTION_UI_VIEWPORT_DEBUG_EVENTS} } - has message => (is => 'rw', isa => Str); has '+model' => (handles => [qw/error_message has_error_message/]); @@ -64,19 +62,6 @@ sub sync_action_from_fields { } } -after handle_events => sub { - my ($self, $events) = @_; - foreach my $event ($self->accept_events) { - unless (exists $events->{$event} ) { - # for <input type="image"... buttons - if ( exists $events->{"${event}.x"} && exists $events->{"${event}.y"} ) { - $self->_dump_event($event, $events->{$event}) if DEBUG_EVENTS; - $self->$event($events->{$event}); - } - } - } -}; - __PACKAGE__->meta->make_immutable; 1; diff --git a/lib/Reaction/UI/Window.pm b/lib/Reaction/UI/Window.pm index 876a286..0289b39 100644 --- a/lib/Reaction/UI/Window.pm +++ b/lib/Reaction/UI/Window.pm @@ -50,7 +50,14 @@ sub flush_events { foreach my $type (qw/query body/) { my $meth = "${type}_parameters"; - my $param_hash = { %{$ctx->req->$meth} }; # yeah, FocusStack deletes it + my $req_param = $ctx->req->$meth; + my $param_hash = { + map { + $_ =~ m/(^r.+\:\w+)\.(x|y)/ ? # for <input type="image"... buttons + ( $1 => $req_param->{$_} ) + : ( $_ => $req_param->{$_} ) + } keys %$req_param + }; # yeah, FocusStack deletes it my @param_keys = keys %$param_hash; if (@param_keys) { for (@param_keys) { |