[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 56a460e7b84119b0986bcb7e3db8dde9210dfc47

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


The branch, FREESIDE_2_3_BRANCH has been updated
       via  56a460e7b84119b0986bcb7e3db8dde9210dfc47 (commit)
      from  c1ed2fa00b9c023cbe2d57cfffcd9a49d183d725 (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 56a460e7b84119b0986bcb7e3db8dde9210dfc47
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 27 14:47:28 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