|
|
@ -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')); |
|
|
|
} |
|
|
|
|
|
|
|