[mapguide-commits] r5411 - trunk/MgDev/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Nov 28 21:25:23 EST 2010


Author: liuar
Date: 2010-11-28 18:25:23 -0800 (Sun, 28 Nov 2010)
New Revision: 5411

Modified:
   trunk/MgDev/Web/src/viewerfiles/
   trunk/MgDev/Web/src/viewerfiles/quickplot.js
Log:
Ticket #1539 - Script error when closing IE window / tab with the Quick Plot preview dialog open in Ajax viewer

In Ajax Viewer, if we close the IE browser's window or tab while the Quick Plot preview dialog is still open, there will be a script error.

It happens only in IE with compressed jxlib.js. The reason is, quickplotpanel page has a unloade event handler which will close the preview dialog. The event handler invokes the PreviewDialog?.cancel() to close the dialog. While cancel() just "fades out" the dialog to have a good visual effect. In IE, the web page will be closed before the "fade out" process finishes, then an error will occur.

The solution is: don't use "fade out" effect. Instead, just completely remove the Jx.Dialog element from mapFrame. A method PreviewDialog?.dispose() is implemented to do this.



Property changes on: trunk/MgDev/Web/src/viewerfiles
___________________________________________________________________
Added: svn:mergeinfo
   + /sandbox/adsk/2.2gp/Web/src/viewerfiles:5392

Modified: trunk/MgDev/Web/src/viewerfiles/quickplot.js
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/quickplot.js	2010-11-27 11:50:28 UTC (rev 5410)
+++ trunk/MgDev/Web/src/viewerfiles/quickplot.js	2010-11-29 02:25:23 UTC (rev 5411)
@@ -770,6 +770,16 @@
             this.closedCallback();
         }
     },
+    dispose : function()
+    {
+        this.jxDialog.blanket.parentNode.removeChild(this.jxDialog.blanket);
+        this.jxDialog.domObj.parentNode.removeChild(this.jxDialog.domObj);
+        // Inform the listener that the dialog is closed
+        if (this.closedCallback)
+        {
+            this.closedCallback();
+        }
+    },
     
     jxDialogContentLoaded : function()
     {
@@ -1094,7 +1104,8 @@
 {
     if (quickPlotPreviewDialog != null)
     {
-        quickPlotPreviewDialog.cancel();
+        quickPlotPreviewDialog.dispose();
+        quickPlotPreviewDialog = null;
     }
 }
 



More information about the mapguide-commits mailing list