Chandra

 view release on metacpan or  search on metacpan

lib/Chandra/Component.pm  view on Meta::CPAN

        $app->eval("var _e=document.getElementById('$cid');if(_e)_e.remove();");
    }

    comp__mounted $self, 0;
    comp__app $self, undef;
    delete $_comp_registry{$cid};

    return $self;
}

sub update {
    my ($self) = @_;
    my $app = comp__app $self;
    return $self unless $app && comp__mounted $self;

    my $cid = $self->_ensure_cid;
    my $inner = $self->_render_inner;
    $app->update("#$cid", $inner);

    $self->on_update if $self->can('on_update');

    return $self;
}

# Update only a sub-section of the component by a stable CSS selector.
# The selector is relative to the component's root element.
# The $html should already have actions rewritten.
sub update_part {
    my ($self, $sub_id, $html) = @_;
    my $app = comp__app $self;
    return $self unless $app && comp__mounted $self;

    $html = $self->_rewrite_actions($html);
    $app->update("#$sub_id", $html);

    return $self;
}



( run in 0.810 second using v1.01-cache-2.11-cpan-13bb782fe5a )