[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 21 Mar 2002 17:53:27 -0000


www		Thu Mar 21 12:53:27 2002 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  Solves unloading of Remote on Explorer on Macs
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.17 loncom/interface/lonmenu.pm:1.18
--- loncom/interface/lonmenu.pm:1.17	Fri Feb 15 15:06:42 2002
+++ loncom/interface/lonmenu.pm	Thu Mar 21 12:53:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.17 2002/02/15 20:06:42 matthew Exp $
+# $Id: lonmenu.pm,v 1.18 2002/03/21 17:53:27 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,9 +59,10 @@
 
 sub switchmenu {
     my ($row,$col,$imgsrc,$texttop,$textbot,$action)=@_;
+    my $openwin=&openmenu();
     return(<<ENDSMENU);
 <script>
-   swmenu=window.open('','LONCAPAmenu');
+   swmenu=$openwin
    swmenu.switchbutton($row,$col,"$imgsrc","$texttop","$textbot","$action");
 </script>
 ENDSMENU
@@ -96,8 +97,16 @@
     return $output;
 }
 
+sub openmenu {
+    if ($ENV{'browser.type'} eq 'explorer') {
+       return "window.open('javascript:void(0);','LONCAPAmenu');";
+   } else {
+       return "window.open('','LONCAPAmenu');";
+   }
+}
+
 sub rawconfig {
-    my $output="swmenu=window.open('','LONCAPAmenu');";
+    my $output="swmenu=".&openmenu();
     my $uname=$ENV{'user.name'};
     my $udom=$ENV{'user.domain'};
     my $adv=$ENV{'user.adv'};