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

raeburn raeburn at source.lon-capa.org
Mon Oct 25 22:31:22 EDT 2021


raeburn		Tue Oct 26 02:31:22 2021 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - Prevent javascript errors in resize_scrollbox() when menu collection is in
    use in which standard components are absent.
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.399 loncom/interface/lonhtmlcommon.pm:1.400
--- loncom/interface/lonhtmlcommon.pm:1.399	Mon Jun  7 06:15:55 2021
+++ loncom/interface/lonhtmlcommon.pm	Tue Oct 26 02:31:22 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.399 2021/06/07 06:15:55 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.400 2021/10/26 02:31:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3433,12 +3433,18 @@
         if (itemid != null) {
             itemh = itemid.offsetHeight;
         }
-        var primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
-        var secondaryheight;
+        var primaryheight = 0;
+        if (document.getElementById('LC_nav_bar') != null) { 
+            primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
+        }
+        var secondaryheight = 0;
         if (document.getElementById('LC_secondary_menu') != null) { 
             secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
         }
-        var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
+        var crumbsheight = 0;
+        if (document.getElementById('LC_breadcrumbs') != null) {
+            crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
+        }
         var dccidheight = 0;
         if (document.getElementById('dccid') != null) {
             dccidheight = document.getElementById('dccid').offsetHeight;




More information about the LON-CAPA-cvs mailing list