svn commit: r1224914 - /ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1224914 - /ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl

adrianc
Author: adrianc
Date: Tue Dec 27 14:31:17 2011
New Revision: 1224914

URL: http://svn.apache.org/viewvc?rev=1224914&view=rev
Log:
Bug fix for lookup screens - jQuery was loaded twice, which resulted in quirky behavior in the lookup screens.

Modified:
    ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl

Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=1224914&r1=1224913&r2=1224914&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Tue Dec 27 14:31:17 2011
@@ -27,7 +27,19 @@ under the License.
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <title>${title?if_exists}</title>
-    <script language="javascript" src="<@ofbizContentUrl>/images/jquery/jquery-1.7.min.js</@ofbizContentUrl>" type="text/javascript"></script>
+    <script language="JavaScript" type="text/javascript">//<![CDATA[
+    var jQueryLibLoaded = false;
+    function initJQuery() {
+        if (typeof(jQuery) == 'undefined') {
+            if (!jQueryLibLoaded) {
+                jQueryLibLoaded = true;
+                document.write("<script type=\"text/javascript\" src=\"<@ofbizContentUrl>/images/jquery/jquery-1.7.min.js</@ofbizContentUrl>\"></script>");
+            }
+            setTimeout("initJQuery()", 50);
+        }
+    }
+    initJQuery();
+    //]]></script>
     <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" type="text/javascript"></script>
     <#if layoutSettings.javaScripts?has_content>
         <#--layoutSettings.javaScripts is a list of java scripts. -->