aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Window.pm
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-03-11 20:53:18 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-03-11 20:53:18 +0000
commitbdfdc97f2f79c7072b5d288344775b9d48968941 (patch)
tree11d6961cebede45fbfe196a5a0f5cd41263e8ca5 /lib/Reaction/UI/Window.pm
parentaca8cf99ff35c52ec5263be6ddf10e8bf50fb1a7 (diff)
downloadreaction-bdfdc97f2f79c7072b5d288344775b9d48968941.tar.gz
reaction-bdfdc97f2f79c7072b5d288344775b9d48968941.zip
dont make events happen unless necesary
Diffstat (limited to 'lib/Reaction/UI/Window.pm')
-rw-r--r--lib/Reaction/UI/Window.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Reaction/UI/Window.pm b/lib/Reaction/UI/Window.pm
index 2865e0e..5eda757 100644
--- a/lib/Reaction/UI/Window.pm
+++ b/lib/Reaction/UI/Window.pm
@@ -27,6 +27,11 @@ sub _build_view {
};
sub flush {
my ($self) = @_;
+ my $res = $self->ctx->res;
+ if ( $res->status =~ /^3/ || length($res->body) ) {
+ $res->content_type('text/plain') unless $res->content_type;
+ return;
+ }
$self->flush_events;
$self->flush_view;
};
@@ -53,10 +58,6 @@ sub flush_events {
sub flush_view {
my ($self) = @_;
my $res = $self->ctx->res;
- if ( $res->status =~ /^3/ || length($res->body) ) {
- $res->content_type('text/plain') unless $res->content_type;
- return;
- }
$res->body($self->view->render_window($self));
$res->content_type($self->content_type);
};