Skip to content

Commit

Permalink
Improve #1129
Browse files Browse the repository at this point in the history
 - Make baner default hight if headerBanner option is not set
 - Prevent themes with old code not working again (ugly hack)
 - Collapse hamburger menu when a link is clicked.
  • Loading branch information
torinfo committed Jun 29, 2022
1 parent 66f5ecc commit b488f3f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions modules/site/parent_templates/site/common/js/application.js
Expand Up @@ -188,6 +188,13 @@ function loadContent(){

fixSideBar();
});

setTimeout(function() {
$('div.nav-collapse li a').click(function () {
$('.navbar-toggler').click();
});
}, 500);

x_xAPI_SessionId = new Date().getTime() + "" + Math.round(Math.random() * 1000000);
}

Expand Down Expand Up @@ -1404,7 +1411,12 @@ function x_navigateToPage(force, pageInfo) { // pageInfo = {type, ID}
}

function x_CheckBanner(index){
debugger
// This routine potentially breaks themes/customcode based on Cardiff's example
// if .scale is set on the jumbotron class, do nothing! Better would be to have a version in the xml of which version created the xml
if ($(".jumbotron").hasClass('scale'))
{
return;
}
const banner = $(data).find('page').eq(index).attr('headerBanner');
if(banner == "fullscreen"){
$(".jumbotron").addClass("x_scale");
Expand Down Expand Up @@ -1441,7 +1453,7 @@ function x_CheckBanner(index){
}, 800);
}

}else if (banner == "fixedheight") {
}else { //if (banner == "fixedheight") {
let height=200;
if ($(data).find('page').eq(index).attr('bannerHeight') !== undefined)
{
Expand All @@ -1452,6 +1464,7 @@ function x_CheckBanner(index){
$(".jumbotron").css({
"height":height + "px"
});
$("#x_clickableWrapper").remove();
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/site/player_html5/rloObject.htm
Expand Up @@ -110,7 +110,7 @@

<div class="container">

<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<button type="button" class="btn btn-navbar navbar-toggler" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Expand Down

0 comments on commit b488f3f

Please sign in to comment.