[freeside-commits] branch master updated. b63fb40fd225e348b06191b535291d5ccf7af956

Ivan ivan at 420.am
Wed Jun 27 14:47:28 PDT 2012


The branch, master has been updated
       via  b63fb40fd225e348b06191b535291d5ccf7af956 (commit)
      from  2d57d71025519495dd1cdfca3799a6652c674637 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b63fb40fd225e348b06191b535291d5ccf7af956
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 27 14:47:27 2012 -0700

    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 d27ca3b..9866cdd 100644
--- a/httemplate/elements/init_overlib.html
+++ b/httemplate/elements/init_overlib.html
@@ -1,9 +1,16 @@
 % for my $file (@files) {
   <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/<%$file%>.js"></SCRIPT>
 % }
+<%once>
+my $initialized = 0; #won't work if component is "preloaded"... so don't do that
+</%once>
 <%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++;
+}
 
 </%init>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/elements/init_overlib.html |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list