Skip to content

Commit

Permalink
Ravem: Show correct name of connected VC (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster authored Feb 10, 2025
1 parent b05d1b8 commit 9913d54
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ravem/indico_ravem/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
// them and/or modify them under the terms of the MIT License; see
// the LICENSE file for more details.

/* eslint-disable func-name-matching */
/* eslint-disable import/unambiguous */

(function() {
const $t = $T.domain('ravem');
const ravemButton = (function makeRavemButton() {
const states = {
connected: {
icon: 'x',
tooltip: $t.gettext('Disconnect {0} from the videoconference room {1}'),
tooltip: $t.gettext('Disconnect {0} from the videoconference room {3}'),
action: 'disconnect',
handler: function disconnectHandler(data, btn) {
const name = btn.data('roomName');
Expand Down Expand Up @@ -192,7 +195,7 @@
/**
* Sets a new state for the button and update its icon, label and tool tip.
*/
function setButtonState(btn, newState, tooltipMessage) {
function setButtonState(btn, newState, tooltipMessage = '', currentVCRoom = '') {
btn.data('state', newState);

const name = btn.data('roomName');
Expand All @@ -203,7 +206,7 @@

tooltipMessage = tooltipMessage ? `${tooltipMessage}<br>` : '';
const qtip = {
content: states[newState].tooltip.format(name, vcRoomName, tooltipMessage),
content: states[newState].tooltip.format(name, vcRoomName, tooltipMessage, currentVCRoom),
position: {my: 'top center', at: 'bottom center'},
show: 'mouseover',
hide: {
Expand Down Expand Up @@ -316,7 +319,7 @@
return;
}
const connected = data.connected;
setButtonState(btn, connected ? 'connected' : 'disconnected');
setButtonState(btn, connected ? 'connected' : 'disconnected', '', data.vc_room_id);
});
return btn;
}
Expand Down

0 comments on commit 9913d54

Please sign in to comment.