Author: ivaynberg
Date: Mon Dec 19 20:31:19 2011
New Revision: 1220937

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

Modified:
    
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Modified: 
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=1220937&r1=1220936&r2=1220937&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
 (original)
+++ 
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
 Mon Dec 19 20:31:19 2011
@@ -1631,14 +1631,19 @@ Wicket.Head.Contributor.prototype = {
                        // 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();
-                       }
-                       else {
-                         img.onerror = function() {
-                       notify();
-                         }
+                 if (!notifyCalled) {
+                               notifyCalled = true;
+                               notify();
+                         }
                }
                });
        },


Reply via email to