Author: jcompagner
Date: Mon Dec  5 15:08:49 2011
New Revision: 1210490

URL: http://svn.apache.org/viewvc?rev=1210490&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/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=1210490&r1=1210489&r2=1210490&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  5 15:08:49 2011
@@ -1679,11 +1679,17 @@ jQuery.noConflict();
                                                // 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 = img.onload = 
function() {
-                                                       notify();
-                                                       img = null;
-                                               };
                                                img.src = css.href;
+                                               if (img.complete) {
+                                        notify();
+                                                img = null;
+                                               }
+                                               else {
+                                                 img.onerror = function() {
+                                               notify();
+                                                       img = null;
+                                         }
+                                       }
                                        });
                                },
                


Reply via email to