From 4cea7018f536891b028784e7495f71fc99fc18a0 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Tue, 18 Jun 2019 12:57:06 -0700 Subject: [PATCH] fix(tile-view): back to single click to pin Undoes the logic added in: ebcde745ef34bd3d45a2d884825fdc48cfa16839 --- modules/UI/shared_video/SharedVideoThumb.js | 1 - modules/UI/videolayout/LocalVideo.js | 1 - modules/UI/videolayout/RemoteVideo.js | 1 - modules/UI/videolayout/SmallVideo.js | 29 +-------------------- 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/modules/UI/shared_video/SharedVideoThumb.js b/modules/UI/shared_video/SharedVideoThumb.js index fe2360b18..6249be3a6 100644 --- a/modules/UI/shared_video/SharedVideoThumb.js +++ b/modules/UI/shared_video/SharedVideoThumb.js @@ -22,7 +22,6 @@ export default function SharedVideoThumb(participant, videoType, VideoLayout) { this.updateDisplayName(); this.container.onclick = this._onContainerClick; - this.container.ondblclick = this._onContainerDoubleClick; } SharedVideoThumb.prototype = Object.create(SmallVideo.prototype); SharedVideoThumb.prototype.constructor = SharedVideoThumb; diff --git a/modules/UI/videolayout/LocalVideo.js b/modules/UI/videolayout/LocalVideo.js index 04fcee85d..eddeb78a7 100644 --- a/modules/UI/videolayout/LocalVideo.js +++ b/modules/UI/videolayout/LocalVideo.js @@ -62,7 +62,6 @@ function LocalVideo(VideoLayout, emitter, streamEndedCallback) { this.updateIndicators(); this.container.onclick = this._onContainerClick; - this.container.ondblclick = this._onContainerDoubleClick; } LocalVideo.prototype = Object.create(SmallVideo.prototype); diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index 065b5a483..a7006a425 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -89,7 +89,6 @@ function RemoteVideo(user, VideoLayout, emitter) { this._stopRemoteControl = this._stopRemoteControl.bind(this); this.container.onclick = this._onContainerClick; - this.container.ondblclick = this._onContainerDoubleClick; } RemoteVideo.prototype = Object.create(SmallVideo.prototype); diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 80c936db1..d926485ca 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -144,7 +144,6 @@ function SmallVideo(VideoLayout) { this.updateView = this.updateView.bind(this); this._onContainerClick = this._onContainerClick.bind(this); - this._onContainerDoubleClick = this._onContainerDoubleClick.bind(this); } /** @@ -859,20 +858,6 @@ SmallVideo.prototype.updateIndicators = function() { ); }; -/** - * Callback invoked when the thumbnail is double clicked. Will pin the - * participant if in tile view. - * - * @param {MouseEvent} event - The click event to intercept. - * @private - * @returns {void} - */ -SmallVideo.prototype._onContainerDoubleClick = function(event) { - if (this._pinningRequiresDoubleClick() && this._shouldTriggerPin(event)) { - APP.store.dispatch(pinParticipant(this.id)); - } -}; - /** * Callback invoked when the thumbnail is clicked and potentially trigger * pinning of the participant. @@ -882,8 +867,7 @@ SmallVideo.prototype._onContainerDoubleClick = function(event) { * @returns {void} */ SmallVideo.prototype._onContainerClick = function(event) { - const triggerPin = this._shouldTriggerPin(event) - && !this._pinningRequiresDoubleClick(); + const triggerPin = this._shouldTriggerPin(event); if (event.stopPropagation && triggerPin) { event.stopPropagation(); @@ -934,17 +918,6 @@ SmallVideo.prototype.togglePin = function() { APP.store.dispatch(pinParticipant(participantIdToPin)); }; -/** - * Returns whether or not clicking to pin the participant needs to be a double - * click instead of a single click. - * - * @private - * @returns {boolean} - */ -SmallVideo.prototype._pinningRequiresDoubleClick = function() { - return shouldDisplayTileView(APP.store.getState()); -}; - /** * Removes the React element responsible for showing connection status, dominant * speaker, and raised hand icons.