You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/02/28 19:18:50 UTC

svn commit: r381726 - /incubator/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Author: weber
Date: Tue Feb 28 10:18:48 2006
New Revision: 381726

URL: http://svn.apache.org/viewcvs?rev=381726&view=rev
Log:
fix javascript style loading

Modified:
    incubator/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: incubator/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=381726&r1=381725&r2=381726&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ incubator/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Tue Feb 28 10:18:48 2006
@@ -52,18 +52,19 @@
     var children = document.getElementsByTagName('head')[0].childNodes;
     for (var i = 0; i < children.length; i++) {
       var child = children[i];
-      if (child.tagName.toUpperCase() == "LINK"
-          && child.href == name
-          && child.ref == "stylesheet"
-          && child.type == "text/css"){
-        return true;
+      if (child.tagName.toUpperCase() == "LINK") {
+        if (child.rel == "stylesheet"
+            && child.type == "text/css"
+            && name ==  child.href.replace(/^http:\/\/.*?\//,"/")){
+          return true;
+        }
       }
     }
     return false;
   },
 
   ensureStyleFile: function(name) {
-    if (!this.styleFileLoaded()) {
+    if (!this.styleFileLoaded(name)) {
       var style = document.createElement('link');
       style.rel  = "stylesheet";
       style.type = "text/css";