Author: ivaynberg
Date: Mon Dec 19 20:40:25 2011
New Revision: 1220939

URL: http://svn.apache.org/viewvc?rev=1220939&view=rev
Log:
porting johan's fix for header contribution loading - another patch to work 
with IE7 an IE8
Issue: WICKET-3927

Modified:
    
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js

Modified: 
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js?rev=1220939&r1=1220938&r2=1220939&view=diff
==============================================================================
--- 
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
 (original)
+++ 
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
 Mon Dec 19 20:40:25 2011
@@ -1589,16 +1589,19 @@
                                                // this makes a second GET 
request to the css but it gets it either from the cache or
                                                // downloads just the first 
several bytes and realizes that the MIME is wrong and ignores the rest
                                                var img = 
document.createElement('img');
+                                               var notifyCalled = false;
+                                               img.onerror = function() {
+                                                       if (!notifyCalled) {
+                                                               notifyCalled = 
true;
+                                                               notify();
+                                                       }
+                                               }
                                                img.src = css.href;
                                                if (img.complete) {
-                                        notify();
-                                                img = null;
-                                               }
-                                               else {
-                                                 img.onerror = function() {
-                                               notify();
-                                                       img = null;
-                                         }
+                                         if (!notifyCalled) {
+                                                       notifyCalled = true;
+                                                       notify();
+                                                 }
                                        }
                                        });
                                },


Reply via email to