[fusion-commits] r2035 - trunk/lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Jan 11 21:36:01 EST 2010


Author: liuar
Date: 2010-01-11 21:36:00 -0500 (Mon, 11 Jan 2010)
New Revision: 2035

Modified:
   trunk/lib/jxlib.uncompressed.js
Log:
This submission fixed ticket #300 
Maps with commercial layers failed to display in supported browsers except IE.

Modified: trunk/lib/jxlib.uncompressed.js
===================================================================
--- trunk/lib/jxlib.uncompressed.js	2010-01-08 09:47:44 UTC (rev 2034)
+++ trunk/lib/jxlib.uncompressed.js	2010-01-12 02:36:00 UTC (rev 2035)
@@ -10239,33 +10239,39 @@
         /* get the chrome image from the background image of the element */
         /* the app: protocol check is for adobe air support */
         var src = c.getStyle('backgroundImage');
-        if (!(src.contains('http://') || src.contains('https://') || src.contains('file://') || src.contains('app:/'))) {
-            src = null;
-        } else {
-            src = src.slice(4,-1);
-            /* this only seems to be IE and Opera, but they add quotes
-             * around the url - yuck
-             */
-            if (src.charAt(0) == '"') {
-                src = src.slice(1,-1);
-            }
+        if(src != null)
+        { 
+        	if (!(src.contains('http://') || src.contains('https://') || src.contains('file://') || src.contains('app:/'))) 
+            {
+                src = null;
+            } 
+            else 
+            {
+                src = src.slice(4,-1);
+                /* this only seems to be IE and Opera, but they add quotes
+                 * around the url - yuck
+                 */
+                if (src.charAt(0) == '"') {
+                    src = src.slice(1,-1);
+                }
 
-            /* and remove the background image */
-            c.setStyle('backgroundImage', 'none');
+                /* and remove the background image */
+                c.setStyle('backgroundImage', 'none');
 
-            /* make chrome */
-            ['TR','TL','BL','BR'].each(function(s){
-                c.adopt(
-                    new Element('div',{
-                        'class':'jxChrome'+s
-                    }).adopt(
-                    new Element('img',{
-                        'class':'png24',
-                        src:src,
-                        alt: '',
-                        title: ''
-                    })));
-            }, this);
+                /* make chrome */
+                ['TR','TL','BL','BR'].each(function(s){
+                    c.adopt(
+                        new Element('div',{
+                            'class':'jxChrome'+s
+                        }).adopt(
+                        new Element('img',{
+                            'class':'png24',
+                            src:src,
+                            alt: '',
+                            title: ''
+                        })));
+                }, this);
+            }
         }
         if (!window.opera) {
             c.adopt(Jx.createIframeShim());
@@ -17283,7 +17289,12 @@
             this.scrollLeft.domObj.addClass('jxBarScrollLeft');
             this.scrollLeft.addEvents({
                click: (function(){
-                   var from = this.scroller.getStyle('left').toInt();
+                   var from = 0;
+                   var leftStyle = this.scroller.getStyle('left');
+                   if(leftStyle)
+                   {
+                       from = leftStyle.toInt();
+                   }
                    if (isNaN(from)) { from = 0; }
                    var to = Math.min(from+100, 0);
                    if (to >= 0) {
@@ -17303,8 +17314,13 @@
             }).addTo(this.domObj);
             this.scrollRight.domObj.addClass('jxBarScrollRight');
             this.scrollRight.addEvents({
-               click: (function(){
-                   var from = this.scroller.getStyle('left').toInt();
+                click: (function(){
+                   var from = 0;
+                   var leftStyle = this.scroller.getStyle('left');
+                   if(leftStyle)
+                   {
+                       from = leftStyle.toInt();
+                   }
                    if (isNaN(from)) { from = 0; }
                    var to = Math.max(from - 100, this.scrollWidth);
                    if (to == this.scrollWidth) {
@@ -17363,7 +17379,12 @@
         }, this);
         if (this.scrollWidth < 0) {
             /* we need to show scrollers on at least one side */
-            var l = this.scroller.getStyle('left').toInt();
+            var l = 0;
+            var leftStyle = this.scroller.getStyle('left');
+            if(leftStyle)
+            {
+                l = leftStyle.toInt();
+            }
             if (l < 0) {
                 this.scrollLeft.domObj.setStyle('visibility','');
             } else {
@@ -17388,7 +17409,12 @@
              */
             this.scrollLeft.domObj.setStyle('visibility','hidden');
             this.scrollRight.domObj.setStyle('visibility','hidden');
-            var from = this.scroller.getStyle('left').toInt();
+            var from = 0;
+            var leftStyle = this.scroller.getStyle('left');
+            if(leftStyle)
+            {
+               from = leftStyle.toInt();
+            }            
             if (!isNaN(from) && from !== 0) {
                 if ($defined(this.scrollFx)) {
                     this.scrollFx.start('left', 0);
@@ -17465,7 +17491,12 @@
         //the component was first created.
         
         //So, get the left value first
-        var l = this.scroller.getStyle('left');
+        var l = 0;
+        var leftStyle = this.scroller.getStyle('left');
+        if(leftStyle)
+        {
+            l = leftStyle.toInt();
+        }
         //then check to see if it's auto or a zero length string 
         if (l === 'auto' || l.length <= 0) {
             //If so, set to 0.
@@ -18293,3 +18324,4 @@
     }
 });
 
+



More information about the fusion-commits mailing list