--- loncom/interface/loncommon.pm 2023/11/18 21:12:45 1.1419 +++ loncom/interface/loncommon.pm 2023/11/19 21:28:17 1.1421 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1419 2023/11/18 21:12:45 raeburn Exp $ +# $Id: loncommon.pm,v 1.1421 2023/11/19 21:28:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2441,6 +2441,103 @@ END =pod +=item * &iframe_wrapper_headjs() + +# +# Where iframe is in use, if window.onload() executes before the custom resize function +# has been defined (jQuery), two global javascript vars (LCnotready and LCresizedef) +# are used to ensure document.ready() triggers a call to resize, so the iframe contents +# do not obscure the Functions menu. +# + +=back + +=cut + + +sub iframe_wrapper_headjs { + return <<"ENDJS"; + + +ENDJS + +} + +=pod + +=item * &iframe_wrapper_resizejs() + +# +# jQuery to use when iframe is in use and a page resize occurs. +# This script will ensure that the iframe does not obscure any +# standard LON-CAPA inline menus (primary, secondary, and/or +# breadcrumbs and Functions menus. Expects javascript from +# &iframe_wrapper_headjs() to be in head portion of the web page, +# e.g., by inclusion in second arg passed to &start_page(). +# + +=back + +=cut + +sub iframe_wrapper_resizejs { + my $offset = 5; + &get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']); + if (($env{'form.inhibitmenu'} eq 'yes') || ($env{'form.only_body'})) { + $offset = 0; + } + return &Apache::lonhtmlcommon::scripttag(<{'collapsible_header'}) { + my $alttext = &mt('menu state: collapsed'); + my $tooltip = &mt('display standard menus'); + $bodytag .= <<"END"; +
+
+$alttext
+
'; + } return $bodytag; } @@ -7041,6 +7152,14 @@ form, .inline { display: inline; } +.LC_menus_content.shown{ + display: inline; +} + +.LC_menus_content.hidden { + display: none; +} + .LC_right { text-align:right; } @@ -7061,6 +7180,12 @@ form, .inline { width:400px; } +#LC_collapsible_separator { + border: 1px solid black; + width: 99.9%; + height: 0px; +} + .LC_iframecontainer { width: 98%; margin: 0;