Author: jcompagner
Date: Mon Dec 5 15:02:35 2011
New Revision: 1210488
URL: http://svn.apache.org/viewvc?rev=1210488&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.5.x/ (props changed)
wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Propchange: wicket/branches/wicket-1.5.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 5 15:02:35 2011
@@ -1,3 +1,3 @@
-/wicket/branches/wicket-1.4.x:963681,1027877
+/wicket/branches/wicket-1.4.x:963681,1027877,1210482
/wicket/sandbox/jthomerson/experimental/wicket-devutils:760296-760351,760353-760355
/wicket/trunk/wicket-devutils:760352
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=1210488&r1=1210487&r2=1210488&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 5 15:02:35 2011
@@ -1630,10 +1630,15 @@ 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();
+ }
+ }
});
},