Browse Source

feat(small-video): use AtlasKit tooltip

efficient_tiling
Leonard Kim 7 years ago
parent
commit
38e2443ab7

+ 1
- 2
css/_filmstrip.scss View File

11
     right: 0;
11
     right: 0;
12
     padding: 10px 5px;
12
     padding: 10px 5px;
13
     @extend %align-right;
13
     @extend %align-right;
14
+    z-index: $filmstripVideosZ;
14
 
15
 
15
     &__toolbar {
16
     &__toolbar {
16
         @include flex();
17
         @include flex();
17
         flex-direction: column-reverse;
18
         flex-direction: column-reverse;
18
         flex-wrap: nowrap;
19
         flex-wrap: nowrap;
19
         position: relative;
20
         position: relative;
20
-        z-index: $zindex1; // Set z-index to make element visible.
21
         width: $filmstripToggleButtonWidth;
21
         width: $filmstripToggleButtonWidth;
22
 
22
 
23
         button {
23
         button {
53
         /* The filmstrip should not be covered by the left toolbar. */
53
         /* The filmstrip should not be covered by the left toolbar. */
54
         bottom: 0;
54
         bottom: 0;
55
         width:auto;
55
         width:auto;
56
-        z-index: $filmstripVideosZ;
57
         transition: bottom 2s;
56
         transition: bottom 2s;
58
         overflow: visible !important;
57
         overflow: visible !important;
59
         /*!!! Removes the gap between the local video container and the remote
58
         /*!!! Removes the gap between the local video container and the remote

+ 23
- 4
css/_vertical_filmstrip_overrides.scss View File

112
             &__toolbar {
112
             &__toolbar {
113
                 text-align: right;
113
                 text-align: right;
114
 
114
 
115
-                .toolbar-icon {
115
+                .right {
116
                     float: none;
116
                     float: none;
117
                     margin: auto;
117
                     margin: auto;
118
                 }
118
                 }
193
      */
193
      */
194
     .connection-indicator,
194
     .connection-indicator,
195
     .remote-video-menu-trigger,
195
     .remote-video-menu-trigger,
196
-    .videocontainer__toolbar,
197
-    .raisehandindicator,
198
-    #dominantspeakerindicator {
196
+    .indicator-icon-container {
199
         transform: translate3d(0, 0, 0);
197
         transform: translate3d(0, 0, 0);
200
     }
198
     }
199
+
200
+    .indicator-container {
201
+        float: none;
202
+    }
203
+
204
+    /**
205
+     * FIXME: disable pointer to allow any elements moved below to still be
206
+     * clickable. The real fix would to make sure those moved elements are
207
+     * actually part of the toolbar instead of positioning being faked.
208
+     */
209
+    .videocontainer__toolbar {
210
+        pointer-events: none;
211
+
212
+        > div {
213
+            pointer-events: none;
214
+        }
215
+
216
+        .toolbar-icon {
217
+            pointer-events: all;
218
+        }
219
+    }
201
 }
220
 }

+ 42
- 17
css/_videolayout_default.scss View File

41
     &__toptoolbar {
41
     &__toptoolbar {
42
         position: absolute;
42
         position: absolute;
43
         left: 0;
43
         left: 0;
44
-        z-index: $zindex3;
44
+        pointer-events: none;
45
+        z-index: $zindex10;
45
         width: 100%;
46
         width: 100%;
46
         box-sizing: border-box; // Includes the padding in the 100% width.
47
         box-sizing: border-box; // Includes the padding in the 100% width.
48
+
49
+        /**
50
+         * FIXME (lenny): Disabling pointer-events is a pretty big sin that
51
+         * sidesteps the problems. There are z-index wars occurring within
52
+         * videocontainer and AtlasKit Tooltips rely on their parent z-indexe
53
+         * being higher than whatever they need to appear over. So set a higher
54
+         * z-index for the tooltip containers but make any empty space not block
55
+         * mouse overs for various mouseover triggers.
56
+         */
57
+        pointer-events: none;
58
+
59
+        * {
60
+            pointer-events: auto;
61
+        }
62
+
63
+        .indicator-container {
64
+            display: inline-block;
65
+            float: left;
66
+            pointer-events: all;
67
+        }
47
     }
68
     }
48
 
69
 
49
     &__toolbar {
70
     &__toolbar {
69
             margin-top: $toolbarIconMargin;
90
             margin-top: $toolbarIconMargin;
70
         }
91
         }
71
 
92
 
72
-        .indicator:nth-child(1) {
93
+        .indicator-container:nth-child(1) .indicator {
73
             margin-left: $toolbarIconMargin;
94
             margin-left: $toolbarIconMargin;
74
         }
95
         }
75
 
96
 
76
         .connection-indicator,
97
         .connection-indicator,
77
-        span.indicator {
78
-            margin-right: em(5, 8);
98
+        div.indicator-container,
99
+         {
100
+            margin-right: 4px;
79
         }
101
         }
80
 
102
 
81
-        span.indicator {
82
-            display: none;
83
-
84
-            &:last-child {
85
-                margin-right: 0;
86
-            }
103
+        div.indicator:last-child {
104
+            margin-right: 0;
87
         }
105
         }
88
 
106
 
89
-        .connection-indicator-container {
107
+        .indicator-container {
90
             display: inline-block;
108
             display: inline-block;
91
             vertical-align: top;
109
             vertical-align: top;
92
 
110
 
96
         }
114
         }
97
 
115
 
98
         .connection-indicator,
116
         .connection-indicator,
99
-        span.indicator {
117
+        .indicator {
100
             position: relative;
118
             position: relative;
101
             font-size: 8px;
119
             font-size: 8px;
102
             text-align: center;
120
             text-align: center;
307
     padding: 0;
325
     padding: 0;
308
     border: 0;
326
     border: 0;
309
     margin: 0px 5px 0px 0px;
327
     margin: 0px 5px 0px 0px;
310
-    float: left;
311
 }
328
 }
312
 
329
 
313
 /**
330
 /**
320
 /**
337
 /**
321
  * Toolbar icons positioned on the right.
338
  * Toolbar icons positioned on the right.
322
  */
339
  */
323
-.toolbar-icon.right {
324
-  float: right;
325
-  margin: 0px 0px 0px 5px;
340
+.moderator-icon {
341
+    display: inline-block;
342
+
343
+    &.right {
344
+        float: right;
345
+        margin: 0px 0px 0px 5px;
346
+    }
347
+
348
+    .toolbar-icon {
349
+        margin: 0;
350
+    }
326
 }
351
 }
327
 
352
 
328
 .raisehandindicator {
353
 .raisehandindicator {
340
     position: absolute;
365
     position: absolute;
341
     top: 0px;
366
     top: 0px;
342
     right: 0;
367
     right: 0;
343
-    z-index: $zindex3;
368
+    z-index: $zindex2;
344
     width: 18px;
369
     width: 18px;
345
     height: 13px;
370
     height: 13px;
346
     color: #FFF;
371
     color: #FFF;

+ 2
- 3
lang/main.json View File

168
     },
168
     },
169
     "videothumbnail":
169
     "videothumbnail":
170
     {
170
     {
171
-        "editnickname": "Click to edit your<br/>display name",
172
-        "moderator": "The owner of<br/>this conference",
173
-        "videomute": "Participant has<br/>stopped the camera",
171
+        "moderator": "Moderator",
172
+        "videomute": "Participant has stopped the camera",
174
         "mute": "Participant is muted",
173
         "mute": "Participant is muted",
175
         "kick": "Kick out",
174
         "kick": "Kick out",
176
         "muted": "Muted",
175
         "muted": "Muted",

+ 25
- 9
modules/UI/videolayout/SmallVideo.js View File

316
 SmallVideo.prototype.updateStatusBar = function () {
316
 SmallVideo.prototype.updateStatusBar = function () {
317
     const statusBarContainer
317
     const statusBarContainer
318
         = this.container.querySelector('.videocontainer__toolbar');
318
         = this.container.querySelector('.videocontainer__toolbar');
319
+    const tooltipPosition = interfaceConfig.VERTICAL_FILMSTRIP ? 'left' : 'top';
319
 
320
 
320
     /* jshint ignore:start */
321
     /* jshint ignore:start */
321
     ReactDOM.render(
322
     ReactDOM.render(
322
-        <div>
323
-            { this.isAudioMuted ? <AudioMutedIndicator /> : null }
324
-            { this.isVideoMuted ? <VideoMutedIndicator /> : null }
325
-            { this._isModerator
326
-                && !interfaceConfig.DISABLE_FOCUS_INDICATOR
327
-                    ? <ModeratorIndicator /> : null }
328
-        </div>,
323
+        <I18nextProvider i18n = { i18next }>
324
+            <div>
325
+                { this.isAudioMuted
326
+                    ? <AudioMutedIndicator
327
+                        tooltipPosition = { tooltipPosition } />
328
+                    : null }
329
+                { this.isVideoMuted
330
+                    ? <VideoMutedIndicator
331
+                        tooltipPosition = { tooltipPosition } />
332
+                    : null }
333
+                { this._isModerator
334
+                    && !interfaceConfig.DISABLE_FOCUS_INDICATOR
335
+                        ? <ModeratorIndicator
336
+                             tooltipPosition = { tooltipPosition } />
337
+                        : null }
338
+            </div>
339
+        </I18nextProvider>,
329
         statusBarContainer);
340
         statusBarContainer);
330
     /* jshint ignore:end */
341
     /* jshint ignore:end */
331
 };
342
 };
744
         = this.container.querySelector('.videocontainer__toptoolbar');
755
         = this.container.querySelector('.videocontainer__toptoolbar');
745
 
756
 
746
     const iconSize = UIUtil.getIndicatorFontSize();
757
     const iconSize = UIUtil.getIndicatorFontSize();
758
+    const tooltipPosition = interfaceConfig.VERTICAL_FILMSTRIP ? 'left' : 'top';
747
 
759
 
748
     /* jshint ignore:start */
760
     /* jshint ignore:start */
749
     ReactDOM.render(
761
     ReactDOM.render(
758
                         userID = { this.id } />
770
                         userID = { this.id } />
759
                     : null }
771
                     : null }
760
                 { this._showRaisedHand
772
                 { this._showRaisedHand
761
-                    ? <RaisedHandIndicator iconSize = { iconSize } />
773
+                    ? <RaisedHandIndicator
774
+                        iconSize = { iconSize }
775
+                        tooltipPosition = { tooltipPosition } />
762
                     : null }
776
                     : null }
763
                 { this._showDominantSpeaker
777
                 { this._showDominantSpeaker
764
-                    ? <DominantSpeakerIndicator iconSize = { iconSize } />
778
+                    ? <DominantSpeakerIndicator
779
+                        iconSize = { iconSize }
780
+                        tooltipPosition = { tooltipPosition } />
765
                     : null }
781
                     : null }
766
             </div>
782
             </div>
767
         </I18nextProvider>,
783
         </I18nextProvider>,

+ 1
- 1
react/features/connection-indicator/components/ConnectionIndicator.js View File

175
      */
175
      */
176
     render() {
176
     render() {
177
         return (
177
         return (
178
-            <div className = 'connection-indicator-container'>
178
+            <div className = 'indicator-container'>
179
                 <AKInlineDialog
179
                 <AKInlineDialog
180
                     content = { this._renderStatisticsTable() }
180
                     content = { this._renderStatisticsTable() }
181
                     isOpen = { this.state.showStats }
181
                     isOpen = { this.state.showStats }

+ 14
- 1
react/features/filmstrip/components/web/AudioMutedIndicator.js View File

8
  * @extends Component
8
  * @extends Component
9
  */
9
  */
10
 class AudioMutedIndicator extends Component {
10
 class AudioMutedIndicator extends Component {
11
+    /**
12
+     * {@code AudioMutedIndicator} component's property types.
13
+     *
14
+     * @static
15
+     */
16
+    static propTypes = {
17
+        /**
18
+         * From which side of the indicator the tooltip should appear from.
19
+         */
20
+        tooltipPosition: React.PropTypes.string
21
+    };
22
+
11
     /**
23
     /**
12
      * Implements React's {@link Component#render()}.
24
      * Implements React's {@link Component#render()}.
13
      *
25
      *
19
             <BaseIndicator
31
             <BaseIndicator
20
                 className = 'audioMuted toolbar-icon'
32
                 className = 'audioMuted toolbar-icon'
21
                 iconClassName = 'icon-mic-disabled'
33
                 iconClassName = 'icon-mic-disabled'
22
-                tooltipKey = 'videothumbnail.mute' />
34
+                tooltipKey = 'videothumbnail.mute'
35
+                tooltipPosition = { this.props.tooltipPosition } />
23
         );
36
         );
24
     }
37
     }
25
 }
38
 }

+ 50
- 71
react/features/filmstrip/components/web/BaseIndicator.js View File

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
+import Tooltip from '@atlaskit/tooltip';
2
 
3
 
3
-import { setTooltip } from '../../../../../modules/UI/util/Tooltip';
4
+import { translate } from '../../../base/i18n';
4
 
5
 
5
 /**
6
 /**
6
  * React {@code Component} for showing an icon with a tooltip.
7
  * React {@code Component} for showing an icon with a tooltip.
8
  * @extends Component
9
  * @extends Component
9
  */
10
  */
10
 class BaseIndicator extends Component {
11
 class BaseIndicator extends Component {
12
+    /**
13
+     * Default values for {@code BaseIndicator} component's properties.
14
+     *
15
+     * @static
16
+     */
11
     static defaultProps = {
17
     static defaultProps = {
12
         className: '',
18
         className: '',
13
         iconClassName: '',
19
         iconClassName: '',
14
         iconSize: 'auto',
20
         iconSize: 'auto',
15
-        id: ''
21
+        id: '',
22
+        tooltipPosition: 'top'
16
     };
23
     };
17
 
24
 
25
+    /**
26
+     * {@code BaseIndicator} component's property types.
27
+     *
28
+     * @static
29
+     */
18
     static propTypes = {
30
     static propTypes = {
19
         /**
31
         /**
20
-         * The CSS class names to set on the root element of the component.
32
+         * Additional CSS class names to set on the icon container.
21
          */
33
          */
22
         className: React.PropTypes.string,
34
         className: React.PropTypes.string,
23
 
35
 
36
          */
48
          */
37
         id: React.PropTypes.string,
49
         id: React.PropTypes.string,
38
 
50
 
51
+        /**
52
+         * Invoked to obtain translated strings.
53
+         */
54
+        t: React.PropTypes.func,
55
+
39
         /**
56
         /**
40
          * The translation key to use for displaying a tooltip when hovering
57
          * The translation key to use for displaying a tooltip when hovering
41
          * over the component.
58
          * over the component.
42
          */
59
          */
43
-        tooltipKey: React.PropTypes.string
44
-    };
45
-
46
-    /**
47
-     * Initializes a new {@code BaseIndicator} instance.
48
-     *
49
-     * @param {Object} props - The read-only properties with which the new
50
-     * instance is to be initialized.
51
-     */
52
-    constructor(props) {
53
-        super(props);
60
+        tooltipKey: React.PropTypes.string,
54
 
61
 
55
         /**
62
         /**
56
-         * An internal reference to the HTML element at the top of the
57
-         * component's DOM hierarchy. The reference is needed for attaching a
58
-         * tooltip.
59
-         *
60
-         * @type {HTMLElement}
63
+         * From which side of the indicator the tooltip should appear from.
64
+         * Defaults to "top".
61
          */
65
          */
62
-        this._rootElement = null;
63
-
64
-        // Bind event handler so it is only bound once for every instance.
65
-        this._setRootElementRef = this._setRootElementRef.bind(this);
66
-    }
67
-
68
-    /**
69
-     * Sets a tooltip which will display when hovering over the component.
70
-     *
71
-     * @inheritdoc
72
-     * @returns {void}
73
-     */
74
-    componentDidMount() {
75
-        this._setTooltip();
76
-    }
66
+        tooltipPosition: React.PropTypes.string
67
+    };
77
 
68
 
78
     /**
69
     /**
79
      * Implements React's {@link Component#render()}.
70
      * Implements React's {@link Component#render()}.
82
      * @returns {ReactElement}
73
      * @returns {ReactElement}
83
      */
74
      */
84
     render() {
75
     render() {
85
-        return (
86
-            <span
87
-                className = { this.props.className }
88
-                id = { this.props.id }
89
-                ref = { this._setRootElementRef }>
90
-                <i
91
-                    className = { this.props.iconClassName }
92
-                    style = {{ fontSize: this.props.iconSize }} />
93
-            </span>
94
-        );
95
-    }
76
+        const {
77
+            className,
78
+            iconClassName,
79
+            iconSize,
80
+            id,
81
+            t,
82
+            tooltipKey,
83
+            tooltipPosition
84
+        } = this.props;
96
 
85
 
97
-    /**
98
-     * Sets the internal reference to the root HTML element for the component.
99
-     *
100
-     * @param {HTMLIconElement} element - The root HTML element of the
101
-     * component.
102
-     * @private
103
-     * @returns {void}
104
-     */
105
-    _setRootElementRef(element) {
106
-        this._rootElement = element;
107
-    }
86
+        const iconContainerClassName = `indicator-icon-container ${className}`;
108
 
87
 
109
-    /**
110
-     * Associate the component as a tooltip trigger so a tooltip may display on
111
-     * hover.
112
-     *
113
-     * @private
114
-     * @returns {void}
115
-     */
116
-    _setTooltip() {
117
-        // TODO Replace UIUtil with an AtlasKit component when a suitable one
118
-        // becomes available for tooltips.
119
-        setTooltip(
120
-            this._rootElement,
121
-            this.props.tooltipKey,
122
-            'top'
88
+        return (
89
+            <div className = 'indicator-container'>
90
+                <Tooltip
91
+                    description = { t(tooltipKey) }
92
+                    position = { tooltipPosition }>
93
+                    <span
94
+                        className = { iconContainerClassName }
95
+                        id = { id }>
96
+                        <i
97
+                            className = { iconClassName }
98
+                            style = {{ fontSize: iconSize }} />
99
+                    </span>
100
+                </Tooltip>
101
+            </div>
123
         );
102
         );
124
     }
103
     }
125
 }
104
 }
126
 
105
 
127
-export default BaseIndicator;
106
+export default translate(BaseIndicator);

+ 8
- 2
react/features/filmstrip/components/web/DominantSpeakerIndicator.js View File

20
          *
20
          *
21
          * @type {number}
21
          * @type {number}
22
          */
22
          */
23
-        iconSize: React.PropTypes.number
23
+        iconSize: React.PropTypes.number,
24
+
25
+        /**
26
+         * From which side of the indicator the tooltip should appear from.
27
+         */
28
+        tooltipPosition: React.PropTypes.string
24
     };
29
     };
25
 
30
 
26
     /**
31
     /**
35
                 iconClassName = 'indicatoricon fa fa-bullhorn'
40
                 iconClassName = 'indicatoricon fa fa-bullhorn'
36
                 iconSize = { `${this.props.iconSize}px` }
41
                 iconSize = { `${this.props.iconSize}px` }
37
                 id = 'dominantspeakerindicator'
42
                 id = 'dominantspeakerindicator'
38
-                tooltipKey = 'speaker' />
43
+                tooltipKey = 'speaker'
44
+                tooltipPosition = { this.props.tooltipPosition } />
39
         );
45
         );
40
     }
46
     }
41
 }
47
 }

+ 19
- 4
react/features/filmstrip/components/web/ModeratorIndicator.js View File

8
  * @extends Component
8
  * @extends Component
9
  */
9
  */
10
 class ModeratorIndicator extends Component {
10
 class ModeratorIndicator extends Component {
11
+    /**
12
+     * {@code ModeratorIndicator} component's property types.
13
+     *
14
+     * @static
15
+     */
16
+    static propTypes = {
17
+        /**
18
+         * From which side of the indicator the tooltip should appear from.
19
+         */
20
+        tooltipPosition: React.PropTypes.string
21
+    };
22
+
11
     /**
23
     /**
12
      * Implements React's {@link Component#render()}.
24
      * Implements React's {@link Component#render()}.
13
      *
25
      *
16
      */
28
      */
17
     render() {
29
     render() {
18
         return (
30
         return (
19
-            <BaseIndicator
20
-                className = 'focusindicator toolbar-icon right'
21
-                iconClassName = 'icon-star'
22
-                tooltipKey = 'videothumbnail.moderator' />
31
+            <div className = 'moderator-icon right'>
32
+                <BaseIndicator
33
+                    className = 'focusindicator toolbar-icon'
34
+                    iconClassName = 'icon-star'
35
+                    tooltipKey = 'videothumbnail.moderator'
36
+                    tooltipPosition = { this.props.tooltipPosition } />
37
+            </div>
23
         );
38
         );
24
     }
39
     }
25
 }
40
 }

+ 8
- 2
react/features/filmstrip/components/web/RaisedHandIndicator.js View File

19
          *
19
          *
20
          * @type {number}
20
          * @type {number}
21
          */
21
          */
22
-        iconSize: React.PropTypes.number
22
+        iconSize: React.PropTypes.number,
23
+
24
+        /**
25
+         * From which side of the indicator the tooltip should appear from.
26
+         */
27
+        tooltipPosition: React.PropTypes.string
23
     };
28
     };
24
 
29
 
25
     /**
30
     /**
33
                 className = 'raisehandindicator indicator show-inline'
38
                 className = 'raisehandindicator indicator show-inline'
34
                 iconClassName = 'icon-raised-hand indicatoricon'
39
                 iconClassName = 'icon-raised-hand indicatoricon'
35
                 iconSize = { `${this.props.iconSize}px` }
40
                 iconSize = { `${this.props.iconSize}px` }
36
-                tooltipKey = 'raisedHand' />
41
+                tooltipKey = 'raisedHand'
42
+                tooltipPosition = { this.props.tooltipPosition } />
37
         );
43
         );
38
     }
44
     }
39
 }
45
 }

+ 14
- 1
react/features/filmstrip/components/web/VideoMutedIndicator.js View File

7
  * @extends Component
7
  * @extends Component
8
  */
8
  */
9
 class VideoMutedIndicator extends Component {
9
 class VideoMutedIndicator extends Component {
10
+    /**
11
+     * {@code VideoMutedIndicator} component's property types.
12
+     *
13
+     * @static
14
+     */
15
+    static propTypes = {
16
+        /**
17
+         * From which side of the indicator the tooltip should appear from.
18
+         */
19
+        tooltipPosition: React.PropTypes.string
20
+    };
21
+
10
     /**
22
     /**
11
      * Implements React's {@link Component#render()}.
23
      * Implements React's {@link Component#render()}.
12
      *
24
      *
17
             <BaseIndicator
29
             <BaseIndicator
18
                 className = 'videoMuted toolbar-icon'
30
                 className = 'videoMuted toolbar-icon'
19
                 iconClassName = 'icon-camera-disabled'
31
                 iconClassName = 'icon-camera-disabled'
20
-                tooltipKey = 'videothumbnail.videomute' />
32
+                tooltipKey = 'videothumbnail.videomute'
33
+                tooltipPosition = { this.props.tooltipPosition } />
21
         );
34
         );
22
     }
35
     }
23
 }
36
 }

Loading…
Cancel
Save