Skip to content

Commit 3866a8a

Browse files
committed
Automatically close the sidebar when opening changelog conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent f75cafe commit 3866a8a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

js/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@
393393
// happens it will overlap with the content area (the narrower the
394394
// window the larger the overlap). Due to this the sidebar is opened
395395
// automatically only if it will not overlap with the content area.
396-
if ($(window).width() > 1111) {
396+
if (this.activeRoom.get('type') === this.ROOM_TYPE_CHANGELOG) {
397+
this._sidebarView.close();
398+
} else if (this.activeRoom.get('type') !== this.ROOM_TYPE_CHANGELOG && $(window).width() > 1111) {
397399
this._sidebarView.open();
398400
}
399401

js/views/callinfoview.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@
148148

149149
initialize: function() {
150150
var nameAttribute = 'name';
151-
if (this.model.get('objectType') === 'share:password') {
151+
if (this.model.get('objectType') === 'share:password' ||
152+
this.model.get('type') === OCA.SpreedMe.app.ROOM_TYPE_CHANGELOG) {
152153
nameAttribute = 'displayName';
153154
}
154155

@@ -271,9 +272,12 @@
271272
// This has to be added below the "enable/disableEdition" calls as
272273
// those calls render the view if needed, while the setters expect
273274
// the view to be already rendered.
274-
if (this.model.get('type') === 1) {
275+
if (this.model.get('type') === OCA.SpreedMe.app.ROOM_TYPE_ONE_TO_ONE) {
275276
this._nameEditableTextLabel.setModelAttribute(undefined);
276277
this._nameEditableTextLabel.setLabelPlaceholder(t('spreed', 'Conversation with {name}', {name: this.model.get('displayName')}));
278+
} else if (this.model.get('type') === OCA.SpreedMe.app.ROOM_TYPE_CHANGELOG) {
279+
this._nameEditableTextLabel.setModelAttribute(undefined);
280+
this._nameEditableTextLabel.setLabelPlaceholder(this.model.get('displayName'));
277281
} else {
278282
this._nameEditableTextLabel.setModelAttribute('name');
279283
this._nameEditableTextLabel.setLabelPlaceholder(t('spreed', 'Conversation name'));

0 commit comments

Comments
 (0)