diff --git a/css/style.css b/css/style.css index 4cc57e8686..732aa22856 100644 --- a/css/style.css +++ b/css/style.css @@ -628,6 +628,10 @@ video { display: inline-block; } +#app-sidebar.hidden { + display: none !important; +} + #participantTabView .participant-moderator-indicator { opacity: .5; font-weight: 300; diff --git a/js/views/roomlistview.js b/js/views/roomlistview.js index cf4a2ea8b8..ee31c4b5bb 100644 --- a/js/views/roomlistview.js +++ b/js/views/roomlistview.js @@ -158,11 +158,7 @@ if (this.model.get('active')) { this.$el.addClass('active'); this.addRoomMessage(); - if (!_.isUndefined(this.model)) { - OCA.SpreedMe.app._participants.setRoom(this.model); - OCA.SpreedMe.app._participants.fetch(); - OCA.SpreedMe.app._participantsView.render(); - } + this.updateSidebar(); } else { this.$el.removeClass('active'); } @@ -174,6 +170,28 @@ this.toggleMenuClass(); }, + updateSidebar: function() { + var $content = $('#app-content'), + $sidebar = $content.find('#app-sidebar'); + + $sidebar.find('.room-name').text(this.model.get('displayName')); + + OCA.SpreedMe.app._participants.setRoom(this.model); + OCA.SpreedMe.app._participants.fetch(); + OCA.SpreedMe.app._participantsView.render(); + + if (!$content.hasClass('with-app-sidebar')) { + $content.addClass('with-app-sidebar'); + $sidebar.removeClass('hidden'); + } + }, + hideSidebar: function() { + var $content = $('#app-content'), + $sidebar = $content.find('#app-sidebar'); + + $content.removeClass('with-app-sidebar'); + $sidebar.addClass('hidden'); + }, events: { 'click .app-navigation-entry-utils-menu-button button': 'toggleMenu', 'click .app-navigation-entry-menu .add-person-button': 'addPerson', @@ -326,6 +344,7 @@ // If user is in that room, it should leave the associated call first. if (this.model.get('active')) { OCA.SpreedMe.Calls.leaveCurrentCall(true); + this.hideSidebar(); } this.$el.slideUp(); @@ -344,6 +363,7 @@ //If user is in that room, it should leave that room first. if (this.model.get('active')) { OCA.SpreedMe.Calls.leaveCurrentCall(true); + this.hideSidebar(); OC.Util.History.pushState({}, OC.generateUrl('/apps/spreed')); } diff --git a/templates/index.php b/templates/index.php index b23d9d706f..4edadd479b 100644 --- a/templates/index.php +++ b/templates/index.php @@ -37,10 +37,12 @@ script( -