Skip to content

Commit

Permalink
Merge branch 'hideFooterBar' into 'staging'
Browse files Browse the repository at this point in the history
hide the footerbar when in lobby and fullscreen (re-activate with hover)

Fixes #459

See merge request !562
  • Loading branch information
kqc-real committed Nov 5, 2016
2 parents e69adcc + ee08b00 commit 0f45f10
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
29 changes: 29 additions & 0 deletions arsnova.click/client/layout/region_footer/scripts/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ const clickEvents = {
}
},
"click #fullscreen, switchChange.bootstrapSwitch .bootstrap-switch-id-fullscreen_switch ": function () {
var route = Router.current().route.getName();
route = route.replace(/(:quizName.)*(.:id)*/g, "");

if (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement) {
if (document.cancelFullScreen) {
document.cancelFullScreen();
Expand All @@ -75,6 +78,11 @@ const clickEvents = {
} else if (document.webkitFullscreenElement) {
document.webkitCancelFullScreen();
}

if (route === "memberlist") {
$('.navbar-footer-placeholder').hide();
$('.navbar-footer').show();
}
} else {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
Expand All @@ -83,6 +91,11 @@ const clickEvents = {
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen();
}

if (route === "memberlist") {
$('.navbar-footer').hide();
$('.navbar-footer-placeholder').show();
}
}
},
"click #import": function () {
Expand Down Expand Up @@ -377,6 +390,22 @@ const defaultBackButtonBehavior = {
Template.footer.events($.extend({}, clickEvents, {
"click #show-more": function () {
Router.go("/" + Router.current().params.quizName + "/showMore");
},
"mouseenter .navbar-footer-placeholder": function () {
var route = Router.current().route.getName();
route = route.replace(/(:quizName.)*(.:id)*/g, "");
if (window.innerHeight == screen.height && route === "memberlist") {
$('.navbar-footer-placeholder').hide();
$('.navbar-footer').show();
}
},
"mouseleave .navbar-footer": function () {
var route = Router.current().route.getName();
route = route.replace(/(:quizName.)*(.:id)*/g, "");
if (window.innerHeight == screen.height && route === "memberlist") {
$('.navbar-footer').hide();
$('.navbar-footer-placeholder').show();
}
}
}));

Expand Down
6 changes: 6 additions & 0 deletions arsnova.click/client/layout/region_footer/styles/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
}
}

.navbar-footer-placeholder {
height: 56px;
width: 100%;
display:none;
}

.showMoreCheckboxLabel {
margin-bottom: 0;
line-height: 30px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
{{> hiddenFooterElement}}
{{/each}}
</nav>
<nav class="navbar-footer-placeholder navbar-fixed-bottom">
</nav>
</template>

<template name="hiddenFooterElement">
Expand Down

0 comments on commit 0f45f10

Please sign in to comment.