From 93aac798f38e5339ae346c704a0b914a5c87b35b Mon Sep 17 00:00:00 2001 From: isymchych Date: Thu, 28 Jan 2016 16:36:55 +0200 Subject: [PATCH] do not pin participant if moderator clicked item in remote user menu --- conference.js | 2 +- modules/UI/videolayout/RemoteVideo.js | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/conference.js b/conference.js index abf88f065..d992349a1 100644 --- a/conference.js +++ b/conference.js @@ -111,7 +111,7 @@ class ConferenceConnector { this._reject(err); } _onConferenceFailed(err, ...params) { - console.error('CONFERENCE FAILED:', err, params); + console.error('CONFERENCE FAILED:', err, ...params); switch (err) { // room is locked by the password case ConferenceErrors.PASSWORD_REQUIRED: diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index ae1852b60..bd38260d5 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -86,13 +86,12 @@ if (!interfaceConfig.filmStripOnly) { muteLinkItem.className = 'mutelink disabled'; } - var self = this; - muteLinkItem.onclick = function(){ + muteLinkItem.onclick = (event) => { if ($(this).attr('disabled')) { event.preventDefault(); } - var isMute = !!self.isMuted; - self.emitter.emit(UIEvents.REMOTE_AUDIO_MUTED, self.id); + var isMute = !!this.isMuted; + this.emitter.emit(UIEvents.REMOTE_AUDIO_MUTED, this.id); popupmenuElement.setAttribute('style', 'display:none;'); @@ -120,8 +119,8 @@ if (!interfaceConfig.filmStripOnly) { var ejectText = "
 
"; ejectLinkItem.innerHTML = ejectIndicator + ' ' + ejectText; - ejectLinkItem.onclick = function(){ - self.emitter.emit(UIEvents.USER_KICKED, self.id); + ejectLinkItem.onclick = (event) => { + this.emitter.emit(UIEvents.USER_KICKED, this.id); popupmenuElement.setAttribute('style', 'display:none;'); }; @@ -225,8 +224,12 @@ RemoteVideo.prototype.addRemoteStreamElement = function (stream) { // Add click handler. let onClickHandler = (event) => { + let source = event.target || event.srcElement; - this.VideoLayout.handleVideoThumbClicked(false, this.id); + // ignore click if it was done in popup menu + if ($(source).parents('.popupmenu').length === 0) { + this.VideoLayout.handleVideoThumbClicked(false, this.id); + } // On IE we need to populate this handler on video // and it does not give event instance as an argument,