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

raeburn raeburn at source.lon-capa.org
Sat Dec 22 09:45:36 EST 2012


raeburn		Sat Dec 22 14:45:36 2012 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - Breadcrumbs.
    - Only call &render_tools if there are either crumbs, or there area
      navigation arrows or standard tools to display.
    - Only call &render_advtools if there are items to show in: "Functions". 
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.338 loncom/interface/lonhtmlcommon.pm:1.339
--- loncom/interface/lonhtmlcommon.pm:1.338	Tue Dec 18 15:27:46 2012
+++ loncom/interface/lonhtmlcommon.pm	Sat Dec 22 14:45:35 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.338 2012/12/18 15:27:46 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.339 2012/12/22 14:45:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1761,11 +1761,24 @@
                              .$links 
 ;
         }
-        
-        &render_tools(\$links);
-        $links = &htmltag('div', $links, 
-                        { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
-        &render_advtools(\$links);
+        my $nav_and_tools = 0;
+        foreach my $item ('navigation','tools') {
+            if (ref($tools{$item}) eq 'ARRAY') {
+                $nav_and_tools += scalar(@{$tools{$item}})
+            }
+        }
+        if (($links ne '') || ($nav_and_tools)) {
+            &render_tools(\$links);
+            $links = &htmltag('div', $links, 
+                              { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
+        }
+        my $adv_tools = 0;
+        if (ref($tools{'advtools'}) eq 'ARRAY') {
+            $adv_tools = scalar(@{$tools{'advtools'}});
+        }
+        if (($links ne '') || ($adv_tools)) {
+            &render_advtools(\$links);
+        }
 
         # Return the @Crumbs stack to what we started with
         push(@Crumbs,$last);
@@ -3026,7 +3039,10 @@
     }
     if ((chkh == 1) || (listwchange)) {
         var primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
-        var secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
+        var secondaryheight;
+        if (document.getElementById('LC_secondary_menu') != null) { 
+            secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
+        }
         var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
         var dccidheight = 0;
         if (document.getElementById('dccid') != null) {




More information about the LON-CAPA-cvs mailing list