Commit a895c91f authored by JC Brand's avatar JC Brand

Programmatically set the occupants height

since I couldn't find a way to do this with only CSS.
parent 78865bbc
......@@ -445,6 +445,7 @@
// localstorage
this.model.save();
}
this.occupantsview.setOccupantsHeight();
},
afterConnected: function () {
......@@ -2005,9 +2006,10 @@
renderRoomFeatures: function () {
var picks = _.pick(this.chatroomview.model.attributes, ROOM_FEATURES),
iteratee = function (a, v) { return a || v; };
this.$('.chatroom-features').html(
tpl_chatroom_features(
iteratee = function (a, v) { return a || v; },
el = this.el.querySelector('.chatroom-features');
el.innerHTML = tpl_chatroom_features(
_.extend(this.chatroomview.model.toJSON(), {
'has_features': _.reduce(_.values(picks), iteratee),
'label_features': __('Features'),
......@@ -2037,11 +2039,17 @@
'tt_temporary': __('This room will disappear once the last person leaves'),
'tt_unmoderated': __('This room is not being moderated'),
'tt_unsecured': __('This room does not require a password upon entry')
}))
);
}));
this.setOccupantsHeight();
return this;
},
setOccupantsHeight: function () {
var el = this.el.querySelector('.chatroom-features');
this.el.querySelector('.occupant-list').style.cssText =
'height: calc(100% - '+el.offsetHeight+'px - 5em);';
},
onOccupantAdded: function (item) {
var view = this.get(item.get('id'));
if (!view) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment