Added the ability to exit the full screen mode by clicking a button.

This commit is contained in:
Maxim Khlobystov 2015-06-03 14:49:26 -07:00
parent b5e0f6b856
commit 4b9c76dcd9
4 changed files with 40 additions and 4 deletions

View File

@ -223,12 +223,16 @@ Handlebars.registerHelper 'whiteboardSize', (section) ->
$('#chat').addClass('invisible')
$('#users').addClass('invisible')
$('#navbar').addClass('invisible')
$('.fullscreenButton').removeClass('whiteboardFullscreenButton')
$('.fullscreenButton').addClass('exitFullscreenButton')
$('#whiteboard').bind 'webkitfullscreenchange', (e) ->
if document.webkitFullscreenElement is null
$('#whiteboard').unbind('webkitfullscreenchange')
$('#chat').removeClass('invisible')
$('#users').removeClass('invisible')
$('#navbar').removeClass('invisible')
$('.fullscreenButton').removeClass('exitFullscreenButton')
$('.fullscreenButton').addClass('whiteboardFullscreenButton')
redrawWhiteboard()
$(document).bind 'mozfullscreenchange', (e) -> # target is always the document in Firefox
if document.mozFullScreenElement is null
@ -236,6 +240,8 @@ Handlebars.registerHelper 'whiteboardSize', (section) ->
$('#chat').removeClass('invisible')
$('#users').removeClass('invisible')
$('#navbar').removeClass('invisible')
$('.fullscreenButton').removeClass('exitFullscreenButton')
$('.fullscreenButton').addClass('whiteboardFullscreenButton')
redrawWhiteboard()
@closePushMenus = ->

View File

@ -188,3 +188,25 @@
width: 10%;
}
}
.exitFullscreenButton {
position: absolute;
top: 0;
right: 0;
margin-bottom: 0;
padding: 0;
&, &:hover {
background-color: transparent;
}
i {
color: black;
}
@media @desktop-portrait, @landscape {
height: 50px;
width: 50px;
}
@media @mobile-portrait-with-keyboard, @mobile-portrait {
height: 100px;
width: 5%;
}
}

View File

@ -21,14 +21,22 @@ Template.whiteboard.helpers
return ''
Template.whiteboard.events
"click .previousSlide":(event) ->
'click .previousSlide':(event) ->
BBB.goToPreviousPage()
"click .nextSlide":(event) ->
'click .nextSlide':(event) ->
BBB.goToNextPage()
'click .switchSlideButton': (event) ->
$('.tooltip').hide()
"click .whiteboardFullscreenButton": (event, template) ->
'click .whiteboardFullscreenButton': (event, template) ->
enterWhiteboardFullscreen()
'click .exitFullscreenButton': (event, template) ->
if document.exitFullscreen
document.exitFullscreen()
else if document.mozCancelFullScreen
document.mozCancelFullScreen()
else if document.webkitExitFullscreen
document.webkitExitFullscreen()

View File

@ -7,7 +7,7 @@
<div id="whiteboard-paper">
</div>
{{#if isMobile}}
{{> makeButton btn_class="whiteboardFullscreenButton" i_class="ion-arrow-expand"}}
{{> makeButton btn_class="fullscreenButton whiteboardFullscreenButton" i_class="ion-arrow-expand"}}
{{/if}}
</div>
{{#if isCurrentUserPresenter}}