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

raeburn raeburn at source.lon-capa.org
Wed May 4 01:54:51 EDT 2016


raeburn		Wed May  4 05:54:51 2016 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - Improve display of roles page for mobile devices with small viewports.
  - Update documentation.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.446 loncom/interface/lonmenu.pm:1.447
--- loncom/interface/lonmenu.pm:1.446	Fri Apr 15 14:14:09 2016
+++ loncom/interface/lonmenu.pm	Wed May  4 05:54:51 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.446 2016/04/15 14:14:09 raeburn Exp $
+# $Id: lonmenu.pm,v 1.447 2016/05/04 05:54:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -124,9 +124,13 @@
 (no hover psuedo class) via LC_hoverable class for <li> tag for top-
 level item, which employs jQuery to handle behavior on mouseover.
 
-Inputs: 4 - (a) link and (b) target for anchor href in top level item,
-            (c) title for text wrapped by anchor tag in top level item.
-            (d) reference to array of arrays of sub-menu items.
+Inputs: 6 - (a) link and (b) target for anchor href in top level item,
+            (c) title for text wrapped by anchor tag in top level item,
+            (d) reference to array of arrays of sub-menu items,
+            (e) boolean to indicate whether to call &mt() to translate 
+                name of menu item,
+            (f) optional class for <li> element in primary menu, for which
+                sub menu is being generated.
 
  The underlying datastructure used in (d) contains data from mydesk.tab.
  It consists of an array which has an array for each item appearing in
@@ -534,13 +538,13 @@
 }
 
 sub create_submenu {
-    my ($link,$target,$title,$submenu,$translate) = @_;
+    my ($link,$target,$title,$submenu,$translate,$addclass) = @_;
     return unless (ref($submenu) eq 'ARRAY');
     my $disptarget;
     if ($target ne '') {
         $disptarget = ' target="'.$target.'"';
     }
-    my $menu = '<li class="LC_hoverable">'.
+    my $menu = '<li class="LC_hoverable '.$addclass.'">'.
                '<a href="'.$link.'"'.$disptarget.'>'.
                '<span class="LC_nobreak">'.$title.
                '<span class="LC_fontsize_small" style="font-weight:normal;">'.




More information about the LON-CAPA-cvs mailing list