From: Ivan Kohler Date: Wed, 27 Jun 2012 21:47:27 +0000 (-0700) Subject: optimization: don't load overlib javascript more than once, RT#18338 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=b63fb40fd225e348b06191b535291d5ccf7af956 optimization: don't load overlib javascript more than once, RT#18338 --- 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++; +}