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

raeburn raeburn at source.lon-capa.org
Mon May 21 12:24:14 EDT 2012


raeburn		Mon May 21 16:24:14 2012 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - Use javascript to support dropdown in primary menu in IE 6 
    (no :hover pseudo-class).
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.371 loncom/interface/lonmenu.pm:1.372
--- loncom/interface/lonmenu.pm:1.371	Fri May 18 14:27:11 2012
+++ loncom/interface/lonmenu.pm	Mon May 21 16:24:14 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.371 2012/05/18 14:27:11 raeburn Exp $
+# $Id: lonmenu.pm,v 1.372 2012/05/21 16:24:14 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -241,7 +241,8 @@
                         '▼</span></span>';
                 }
             }
-            $menu .= '<li><a href="'.$link.'" target="'.$target.'">'.$title.'</a>';
+            $menu .= '<li class="LC_hoverable">'.
+                     '<a href="'.$link.'" target="'.$target.'">'.$title.'</a>';
             if ($numsub) {
                 $menu .= '<ul>';
                 foreach my $item (@{$primary_submenu{$menuitem->[3]}}) {
@@ -1327,6 +1328,20 @@
    newWin.focus();
 }
 
+(function (\$) {
+  \$(document).ready(function () {
+    \$.single=function(a){return function(b){a[0]=b;return a}}(\$([1]));
+    /*\@cc_on
+      if (!window.XMLHttpRequest) {
+        \$('.LC_hoverable').each(function () {
+          this.attachEvent('onmouseenter', function (evt) { \$.single(evt.srcElement).addClass('hover'); });
+          this.attachEvent('onmouseleave', function (evt) { \$.single(evt.srcElement).removeClass('hover'); });
+        });
+      }
+    \@*/
+  });
+}(jQuery));
+
 ENDUTILITY
 }
 




More information about the LON-CAPA-cvs mailing list