don't recompute packed template on object instantiation
This commit is contained in:
parent
cf60a9e51e
commit
13589977f2
1 changed files with 14 additions and 8 deletions
|
|
@ -35,13 +35,7 @@ property template => (
|
||||||
sub _template_autopack {
|
sub _template_autopack {
|
||||||
my ($self, $new, $old) = @_;
|
my ($self, $new, $old) = @_;
|
||||||
return if $new eq $old;
|
return if $new eq $old;
|
||||||
my $packed = $new;
|
$self->_clear_templatePacked;
|
||||||
HTML::Packer::minify( \$packed, {
|
|
||||||
remove_comments => 1,
|
|
||||||
do_javascript => "shrink",
|
|
||||||
do_stylesheet => "minify",
|
|
||||||
} );
|
|
||||||
$self->templatePacked($packed);
|
|
||||||
}
|
}
|
||||||
property isEditable => (
|
property isEditable => (
|
||||||
noFormPost => 1,
|
noFormPost => 1,
|
||||||
|
|
@ -78,9 +72,21 @@ property namespace => (
|
||||||
);
|
);
|
||||||
property templatePacked => (
|
property templatePacked => (
|
||||||
fieldType => 'hidden',
|
fieldType => 'hidden',
|
||||||
default => undef,
|
|
||||||
noFormPost => 1,
|
noFormPost => 1,
|
||||||
|
lazy => 1,
|
||||||
|
clearer => '_clear_templatePacked',
|
||||||
|
builder => '_build_templatePacked',
|
||||||
);
|
);
|
||||||
|
sub _build_templatePacked {
|
||||||
|
my $self = shift;
|
||||||
|
my $template = $self->template;
|
||||||
|
HTML::Packer::minify( \$template, {
|
||||||
|
remove_comments => 1,
|
||||||
|
do_javascript => 'shrink',
|
||||||
|
do_stylesheet => 'minify',
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
property usePacked => (
|
property usePacked => (
|
||||||
fieldType => 'yesNo',
|
fieldType => 'yesNo',
|
||||||
default => 0,
|
default => 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue