Skip to content

Commit

Permalink
Made the userlist hidden by default on phones.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximKhlobystov committed Aug 27, 2015
1 parent 4ecf1ea commit 89b4bac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bigbluebutton-html5/app/client/globals.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,25 @@ Handlebars.registerHelper "getPollQuestions", ->
window.matchMedia('(orientation: landscape)').matches and # browser is landscape
window.matchMedia('(min-device-aspect-ratio: 1/1)').matches # device is landscape

@isLandscapePhone = () ->
# @phone-landscape media query:
window.matchMedia('(orientation: landscape)').matches and
window.matchMedia('(min-device-aspect-ratio: 1/1)').matches and
window.matchMedia('(max-device-width: 959px)').matches

@isPortraitPhone = () ->
# @phone-portrait media query:
(window.matchMedia('(orientation: portrait)').matches and
window.matchMedia('(max-device-aspect-ratio: 1/1)').matches and
window.matchMedia('(max-device-width: 480px)').matches) or
# @phone-portrait-with-keyboard media query:
(window.matchMedia('(orientation: landscape)').matches and
window.matchMedia('(max-device-aspect-ratio: 1/1)').matches and
window.matchMedia('(max-device-width: 480px)').matches)

@isPhone = () ->
isLandscapePhone() or isPortraitPhone()

# Checks if only one panel (userlist/whiteboard/chatbar) is currently open
@isOnlyOnePanelOpen = () ->
#(getInSession "display_usersList" ? 1 : 0) + (getInSession "display_whiteboard" ? 1 : 0) + (getInSession "display_chatbar" ? 1 : 0) is 1
Expand Down
4 changes: 4 additions & 0 deletions bigbluebutton-html5/app/client/views/users/user_list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ Template.usersList.rendered = ->
minWidth: 200
resize: () ->
adjustChatInputHeight()

Tracker.autorun (comp) ->
setInSession 'userListRenderedTime', TimeSync.serverTime()
if getInSession('userListRenderedTime') isnt undefined
comp.stop()

if isPhone()
$('.sl-left-drawer').addClass('hiddenInLandscape')

0 comments on commit 89b4bac

Please sign in to comment.