Author: nbelaevski
Date: 2008-01-10 19:37:48 -0500 (Thu, 10 Jan 2008)
New Revision: 5284
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
http://jira.jboss.com/jira/browse/RF-1627
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-10 21:04:20 UTC
(rev 5283)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-11 00:37:48 UTC
(rev 5284)
@@ -394,10 +394,18 @@
appendNewHeadElements : function(){
// Append scripts and styles to head, if not presented in page before.
this._appendNewElements("script","src",null,null,["type","language","charset"]);
-
this._appendNewElements("link","href","class",["component","user"],["type","rel","rev","media"],{"class":
"className"});
+
+ var _this = this;
+
this._appendNewElements("link","href","class",["component","user"],["type","rev","media"],{"class":
"className"},
+ function (element, script) {
+ //IE requires to re-set rel or href after insertion to initialize correctly
+ //see
http://jira.jboss.com/jira/browse/RF-1627#action_12394642
+ _this._copyAttribute(element,script,"rel");
+ }
+ );
},
- _appendNewElements : function(tag,href,role,roles,attributes,mappings){
+ _appendNewElements : function(tag,href,role,roles,attributes,mappings,callback){
var head =
document.getElementsByTagName("head")[0]||document.documentElement;
var newscripts = this.getElementsByTagName(tag);
var oldscripts = document.getElementsByTagName(tag);
@@ -468,6 +476,10 @@
} else {
head.appendChild(script);
}
+
+ if (callback) {
+ callback(element,script);
+ }
}
}
}