has _tangent_stacks => (
isa => 'HashRef', is => 'ro', default => sub { {} }
);
- has ctx => (isa => 'Catalyst', is => 'ro', required => 1);
+ has ctx => (isa => 'Catalyst', is => 'ro'); #, required => 1);
implements _build_layout => as {
'';
implements handle_events => as {
my ($self, $events) = @_;
+ my $exists = exists $events->{exists};
+ if ($exists) {
+ my %force = $self->force_events;
+ my @need = grep { !exists $events->{$_} } keys %force;
+ @{$events}{@need} = @force{@need};
+ }
foreach my $event ($self->accept_events) {
if (exists $events->{$event}) {
if (DEBUG_EVENTS) {
my $name = join(' at ', $self, $self->location);
$self->ctx->log->debug(
"Applying Event: $event on $name with value: "
- .$events->{$event}
+ .(defined $events->{$event} ? $events->{$event} : '<undef>')
);
}
$self->$event($events->{$event});
implements accept_events => as { () };
+ implements force_events => as { () };
+
implements event_id_for => as {
my ($self, $name) = @_;
return join(':', $self->location, $name);
arg 'field_id' => event_id 'value_string';
arg 'field_name' => event_id 'value_string' unless defined $_{field_name};
arg 'field_type' => 'text';
+
+ # these two are to fire force_events in viewports
+ # where you can end up without an event for e.g.
+ # HTML checkbox fields
+
+ arg 'exists_event' => event_id 'exists';
+ arg 'exists_value' => 1;
};
implements fragment message_fragment {