aboutsummaryrefslogtreecommitdiff
path: root/app/features
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <s@saghul.net>2018-06-21 09:55:45 +0200
committerHristo Terezov <hristo@jitsi.org>2018-06-28 14:56:55 -0500
commit1d3cfbb5692e6d97ee60e9ff04f9fab663f930e2 (patch)
tree8b44e30be2da1b5dd272e3e9c44f318ed71a481a /app/features
parent79db9fab88a306fc67d9ced3c5d50b8195adaa74 (diff)
Improve dragging experience
The entire page is draggable, except: - buttons - any input type - the filmstrip - the chat panel
Diffstat (limited to 'app/features')
-rw-r--r--app/features/conference/components/Conference.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/app/features/conference/components/Conference.js b/app/features/conference/components/Conference.js
index 71a644b..6051936 100644
--- a/app/features/conference/components/Conference.js
+++ b/app/features/conference/components/Conference.js
@@ -213,7 +213,6 @@ class Conference extends Component<Props, State> {
setupWiFiStats(iframe);
this._api.on('readyToClose', () => this._navigateToHome());
-
this._api.on('videoConferenceJoined',
(conferenceInfo: Object) =>
this._onVideoConferenceJoined(conferenceInfo));
@@ -266,6 +265,7 @@ class Conference extends Component<Props, State> {
* @returns {void}
*/
_onVideoConferenceJoined(conferenceInfo: Object) {
+ setupDragAreas(this._api.getIFrame());
this._setAvatarURL(this.props._avatarURL);
this._setEmail(this.props._email);
@@ -312,6 +312,25 @@ class Conference extends Component<Props, State> {
}
/**
+ * Inject some style into the iframe so everything except the filmstrip, chat,
+ * buttons or any input is draggable.
+ *
+ * @param {Object} iframe - reference to the iframe where the drag areas will
+ * be set.
+ * @returns {void}
+ */
+function setupDragAreas(iframe) {
+ const injectStyle = document.createElement('style');
+
+ injectStyle.type = 'text/css';
+ injectStyle.textContent
+ = 'body { -webkit-app-region: drag; }'
+ + 'button, input { -webkit-app-region: no-drag }'
+ + '#chatconversation, .filmstrip { -webkit-app-region: no-drag; }';
+ iframe.contentDocument.head.appendChild(injectStyle);
+}
+
+/**
* Maps (parts of) the redux state to the React props.
*
* @param {Object} state - The redux state.