undo change allowing domain in redirect_to
[catagits/Reaction.git] / lib / Reaction / UI / Controller.pm
index 46456bd..2d1b843 100644 (file)
@@ -11,7 +11,8 @@ with 'Catalyst::Component::InstancePerContext';
 
 sub build_per_context_instance {
   my ($self, $c, @args) = @_;
-  my $newself =  $self->new($self->_application, {%$self, context => $c, @args});
+  my $class = ref($self) || $self;
+  my $newself =  $class->new($self->_application, {%$self, context => $c, @args});
   return $newself;
 }
 
@@ -26,9 +27,7 @@ sub push_viewport {
       $vp_attr = $vp_attr->[0];
     }
     if (ref($vp_attr) eq 'HASH') {
-      if (my $conf_class = delete $vp_attr->{class}) {
-        $class = $conf_class;
-      }
+      $class = $vp_attr->{class} if defined $vp_attr->{class};
       %args = %{ $self->merge_config_hashes($vp_attr, {@proto_args}) };
     } else {
       $class = $vp_attr;