Author: jcompagner
Date: Mon Dec  5 14:50:26 2011
New Revision: 1210482

URL: http://svn.apache.org/viewvc?rev=1210482&view=rev
Log:
WICKET-3927 Use a resource loading lib to setup order for processing ajax 
response fragments

backport r1177562.


better fix for (mobile) browsers where the img tag is complete right away 
Issue: WICKET-3927

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

Modified: 
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=1210482&r1=1210481&r2=1210482&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
 Mon Dec  5 14:50:26 2011
@@ -1620,11 +1620,16 @@ 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');
-                       img.onerror = function() {
-                               notify();
-                       }
                        img.src = css.href;
-        });
+                       if (img.complete) {
+                notify();
+                       }
+                       else {
+                         img.onerror = function() {
+                       notify();
+                         }
+               }
+       });
        },
        
        // Process an inline style element


Reply via email to