From b63fb40fd225e348b06191b535291d5ccf7af956 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 27 Jun 2012 14:47:27 -0700 Subject: [PATCH] optimization: don't load overlib javascript more than once, RT#18338 --- httemplate/elements/init_overlib.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/httemplate/elements/init_overlib.html b/httemplate/elements/init_overlib.html index d27ca3bda..9866cdd4a 100644 --- a/httemplate/elements/init_overlib.html +++ b/httemplate/elements/init_overlib.html @@ -1,9 +1,16 @@ % for my $file (@files) { % } +<%once> +my $initialized = 0; #won't work if component is "preloaded"... so don't do that + <%init> -my @files = map "overlibmws$_", ( '', qw( _iframe _draggable _crossframe ) ); -push @files, map { "${_}contentmws" } qw( iframe ajax ); +my @files = (); +if ( ! $initialized ) { + push @files, map "overlibmws$_", ( '', qw( _iframe _draggable _crossframe ) ); + push @files, map { "${_}contentmws" } qw( iframe ajax ); + $initialized++; +} -- 2.11.0