Browse Source

Fixes side toolbar container behavior

j8
yanas 9 years ago
parent
commit
50e803f1a0

+ 5
- 0
css/_contact_list.scss View File

@@ -28,6 +28,11 @@
28 28
         padding: 7px 10px;
29 29
         margin: 2px;
30 30
 
31
+        &:hover,
32
+        &:active {
33
+            background: $toolbarSelectBackground;
34
+        }
35
+
31 36
         > p {
32 37
             display: inline-block;
33 38
             vertical-align: middle;

+ 29
- 9
css/_toolbars.scss View File

@@ -79,7 +79,7 @@
79 79
     position:absolute;
80 80
     top: 0px;
81 81
     left: $defaultToolbarSize;
82
-    width:0%;
82
+    width: 0%;
83 83
     height: 100%;
84 84
     max-width: 200px;
85 85
     background-color: rgba(0,0,0,0.8);
@@ -145,7 +145,7 @@ a.button:active,
145 145
 a.button.selected {
146 146
     cursor: pointer;
147 147
     // sum opacity with background layer should give us 0.8
148
-    background: rgba(0, 0, 0, 0.6);
148
+    background: $toolbarSelectBackground;
149 149
 }
150 150
 
151 151
 a.button>#avatar {
@@ -163,7 +163,8 @@ a.button>#avatar {
163 163
  * START of slide in animation for extended toolbar.
164 164
  */
165 165
 @include keyframes(slideInX) {
166
-    100% { transform: translateX(0%); }
166
+  0% { transform: translateX(-100%); }
167
+  100% { transform: translateX(0%); }
167 168
 }
168 169
 
169 170
 .slideInX {
@@ -171,13 +172,32 @@ a.button>#avatar {
171 172
 }
172 173
 
173 174
 @include keyframes(slideOutX) {
174
-    0% { transform: translateX(0%); }
175
-    100% { transform: translateX(-100%); }
175
+  0% { transform: translateX(0%); }
176
+  100% { transform: translateX(-100%); }
176 177
 }
177 178
 
178 179
 .slideOutX {
179 180
   @include animation('slideOutX .5s forwards');
180 181
 }
182
+
183
+@include keyframes(slideInExtX) {
184
+    0% { transform: translateX(-500%); }
185
+    100% { transform: translateX(0%); }
186
+}
187
+
188
+.slideInExtX {
189
+  @include animation('slideInExtX .5s forwards');
190
+}
191
+
192
+@include keyframes(slideOutExtX) {
193
+    0% { transform: translateX(0%); }
194
+    100% { transform: translateX(-500%); }
195
+}
196
+
197
+.slideOutExtX {
198
+  @include animation('slideOutExtX .5s forwards');
199
+}
200
+
181 201
 /**
182 202
  * END of slide out animation for extended toolbar.
183 203
  */
@@ -209,8 +229,8 @@ a.button>#avatar {
209 229
  * START of slide in animation for extended toolbar panel.
210 230
  */
211 231
 @include keyframes(slideInExt) {
212
-    from { width: 0%; }
213
-    to   { width: 20%; }
232
+    from { width: 0px; }
233
+    to   { width: 200px; } // TO FIX: Make this value a percentage.
214 234
 }
215 235
 
216 236
 .slideInExt {
@@ -218,8 +238,8 @@ a.button>#avatar {
218 238
 }
219 239
 
220 240
 @include keyframes(slideOutExt) {
221
-  from { width: 20%; }
222
-  to   { width: 0%; }
241
+  from { width: 200px; } // TO FIX: Make this value a percentage.
242
+  to   { width: 0px; }
223 243
 }
224 244
 
225 245
 .slideOutExt {

+ 5
- 0
css/_variables.scss View File

@@ -8,3 +8,8 @@ $baseFontFamily: 'open_sanslight', 'Helvetica Neue', Helvetica, Arial, sans-seri
8 8
  */
9 9
 $defaultToolbarSize: 50px;
10 10
 
11
+/**
12
+ * Miscellaneous.
13
+ */
14
+$toolbarSelectBackground: rgba(0, 0, 0, 0.6);
15
+

+ 65
- 65
index.html View File

@@ -116,7 +116,7 @@
116 116
                 </span>
117 117
         </div>
118 118
         <div id="subject" class="hide"></div>
119
-        <span id="extendedToolbar" class="toolbar">
119
+        <div id="extendedToolbar" class="toolbar">
120 120
             <a class="button" data-container="body" data-placement="right" data-i18n="[content]toolbar.profile" content="Edit your profile">
121 121
                 <img id="avatar" src="images/avatar2.png"/>
122 122
             </a>
@@ -133,6 +133,7 @@
133 133
                     </li>
134 134
                 </ul>
135 135
             </span>
136
+            <a class="button icon-link" id="toolbar_button_link" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]toolbar.invite" content="Invite others"></a>
136 137
             <a class="button icon-contactList" id="toolbar_contact_list" data-container="body" data-toggle="popover" data-placement="right" shortcut="contactlistpopover"  data-i18n="[content]bottomtoolbar.contactlist" content="Open / close contact list">
137 138
                 <span id="numberOfParticipants"></span>
138 139
             </a>
@@ -141,7 +142,6 @@
141 142
             </a>
142 143
             <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="right" style="display: none"></a>
143 144
             <a class="button icon-security" id="toolbar_button_security" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]toolbar.lock" content="Lock / unlock room"></a>
144
-            <a class="button icon-link" id="toolbar_button_link" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]toolbar.invite" content="Invite others"></a>
145 145
             <a class="button icon-share-doc" id="toolbar_button_etherpad" data-container="body" data-toggle="popover" data-placement="right" content="Shared document" data-i18n="[content]toolbar.etherpad"></a>
146 146
             <a class="button fa fa-share-alt-square" id="toolbar_button_sharedvideo" data-container="body" data-toggle="popover" data-placement="right" content="Share a YouTube video" data-i18n="[content]toolbar.sharedvideo" style="display: none">
147 147
                 <ul id="sharedVideoMutedPopup" class="loginmenu">
@@ -153,7 +153,68 @@
153 153
             <a class="button icon-settings" id="toolbar_button_settings" data-container="body" data-toggle="popover" data-placement="right" content="Settings" data-i18n="[content]toolbar.Settings"></a>
154 154
             <a class="button icon-filmstrip" id="toolbar_film_strip" data-container="body" data-toggle="popover" shortcut="filmstripPopover" data-placement="right" data-i18n="[content]toolbar.filmstrip" content="Show / hide videos"></a>
155 155
             <a class="button fa fa-heart" id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]feedback"></a>
156
-        </span>
156
+            <div id="sideToolbarContainer">
157
+                <div id="chat_container" class="sideToolbarContainer__inner">
158
+                    <div id="nickname">
159
+                        <span data-i18n="chat.nickname.title"></span>
160
+                        <form>
161
+                            <input type='text' id="nickinput" data-i18n="[placeholder]chat.nickname.popover" autofocus>
162
+                        </form>
163
+                    </div>
164
+
165
+                    <div id="chatconversation"></div>
166
+                    <audio id="chatNotification" src="sounds/incomingMessage.wav" preload="auto"></audio>
167
+                    <textarea id="usermsg" data-i18n="[placeholder]chat.messagebox" autofocus></textarea>
168
+                    <div id="smileysarea">
169
+                        <div id="smileys" id="toggle_smileys">
170
+                            <img src="images/smile.svg"/>
171
+                        </div>
172
+                    </div>
173
+                </div>
174
+                <div id="contacts_container" class="sideToolbarContainer__inner">
175
+                    <div class="title" data-i18n="contactlist"></div>
176
+                    <ul id="contacts"></ul>
177
+                </div>
178
+                <div id="settings_container" class="sideToolbarContainer__inner">
179
+                    <div class="title" data-i18n="settings.title"></div>
180
+                    <div class="arrow-up"></div>
181
+                    <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
182
+                    <input type="text" id="setEmail" placeholder="E-Mail">
183
+                    <select id="languages_selectbox"></select>
184
+                    <div id = "startMutedOptions">
185
+                        <label class = "startMutedLabel">
186
+                            <input type="checkbox" id="startAudioMuted">
187
+                            <span  data-i18n="settings.startAudioMuted"></span>
188
+                        </label>
189
+                        <label class = "startMutedLabel">
190
+                            <input type="checkbox" id="startVideoMuted">
191
+                            <span data-i18n="settings.startVideoMuted"></span>
192
+                        </label>
193
+                    </div>
194
+                    <div id="devicesOptions">
195
+                        <label className="devicesOptionsLabel">
196
+                            <span data-i18n="settings.selectCamera"></span>
197
+                            <select id="selectCamera"></select>
198
+                        </label>
199
+                        <label className="devicesOptionsLabel">
200
+                            <span data-i18n="settings.selectMic"></span>
201
+                            <select id="selectMic"></select>
202
+                        </label>
203
+                        <label className="devicesOptionsLabel">
204
+                            <span data-i18n="settings.selectAudioOutput"></span>
205
+                            <select id="selectAudioOutput"></select>
206
+                        </label>
207
+                    </div>
208
+                    <div id="followMeOptions">
209
+                        <label class = "followMeLabel">
210
+                            <input type="checkbox" id="followMeCheckBox">
211
+                            <span  data-i18n="settings.followMe"></span>
212
+                        </label>
213
+                    </div>
214
+                    <a id="downloadlog" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]downloadlogs" ><i class="fa fa-cloud-download"></i></a>
215
+                </div>
216
+            </div>
217
+        </div>
157 218
         <div id="videospace">
158 219
             <div id="largeVideoContainer" class="videocontainer">
159 220
                 <div id="presentation"></div>
@@ -169,7 +230,7 @@
169 230
                     <canvas id="dominantSpeakerAudioLevel"></canvas>
170 231
                 </div>
171 232
                 <div id="largeVideoWrapper">
172
-                    <video id="largeVideo" muted="true" autoplay></video>
233
+                    <video id="largeVideo" muted="true" preload="auto" autoplay></video>
173 234
                 </div>
174 235
                 <span id="videoConnectionMessage"></span>
175 236
                 <span id="videoResolutionLabel">HD</span>
@@ -191,67 +252,6 @@
191 252
                 <audio id="userLeft" src="sounds/left.wav" preload="auto"></audio>
192 253
             </div>
193 254
         </div>
194
-        <div id="sideToolbarContainer">
195
-            <div id="chat_container" class="sideToolbarContainer__inner">
196
-                <div id="nickname">
197
-                    <span data-i18n="chat.nickname.title"></span>
198
-                    <form>
199
-                        <input type='text' id="nickinput" data-i18n="[placeholder]chat.nickname.popover" autofocus>
200
-                    </form>
201
-                </div>
202
-
203
-                <div id="chatconversation"></div>
204
-                <audio id="chatNotification" src="sounds/incomingMessage.wav" preload="auto"></audio>
205
-                <textarea id="usermsg" data-i18n="[placeholder]chat.messagebox" autofocus></textarea>
206
-                <div id="smileysarea">
207
-                    <div id="smileys" id="toggle_smileys">
208
-                        <img src="images/smile.svg"/>
209
-                    </div>
210
-                </div>
211
-            </div>
212
-            <div id="contacts_container" class="sideToolbarContainer__inner">
213
-                <div class="title" data-i18n="contactlist"></div>
214
-                <ul id="contacts"></ul>
215
-            </div>
216
-            <div id="settings_container" class="sideToolbarContainer__inner">
217
-                <div class="title" data-i18n="settings.title"></div>
218
-                <div class="arrow-up"></div>
219
-                <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
220
-                <input type="text" id="setEmail" placeholder="E-Mail">
221
-                <select id="languages_selectbox"></select>
222
-                <div id = "startMutedOptions">
223
-                    <label class = "startMutedLabel">
224
-                        <input type="checkbox" id="startAudioMuted">
225
-                        <span  data-i18n="settings.startAudioMuted"></span>
226
-                    </label>
227
-                    <label class = "startMutedLabel">
228
-                        <input type="checkbox" id="startVideoMuted">
229
-                        <span data-i18n="settings.startVideoMuted"></span>
230
-                    </label>
231
-                </div>
232
-                <div id="devicesOptions">
233
-                    <label className="devicesOptionsLabel">
234
-                        <span data-i18n="settings.selectCamera"></span>
235
-                        <select id="selectCamera"></select>
236
-                    </label>
237
-                    <label className="devicesOptionsLabel">
238
-                        <span data-i18n="settings.selectMic"></span>
239
-                        <select id="selectMic"></select>
240
-                    </label>
241
-                    <label className="devicesOptionsLabel">
242
-                        <span data-i18n="settings.selectAudioOutput"></span>
243
-                        <select id="selectAudioOutput"></select>
244
-                    </label>
245
-                </div>
246
-                <div id="followMeOptions">
247
-                    <label class = "followMeLabel">
248
-                        <input type="checkbox" id="followMeCheckBox">
249
-                        <span  data-i18n="settings.followMe"></span>
250
-                    </label>
251
-                </div>
252
-                <a id="downloadlog" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]downloadlogs" ><i class="fa fa-cloud-download"></i></a>
253
-            </div>
254
-        </div>
255 255
     </div>
256 256
     <div id="keyboard-shortcuts" class="keyboard-shortcuts" style="display:none;">
257 257
         <div class="header"><h3 data-i18n="keyboardShortcuts.keyboardShortcuts"></h3></div>

+ 23
- 3
modules/UI/side_pannels/SideContainerToggler.js View File

@@ -57,7 +57,7 @@ const SideContainerToggler = {
57 57
     },
58 58
 
59 59
     /**
60
-     * Returns {true} if the extended toolbar panel is currently visible,
60
+     * Returns {true} if the side toolbar panel is currently visible,
61 61
      * otherwise returns {false}.
62 62
      */
63 63
     isVisible() {
@@ -65,7 +65,15 @@ const SideContainerToggler = {
65 65
     },
66 66
 
67 67
     /**
68
-     * Hides the extended toolbar panel with a slide out animation.
68
+     * Returns {true} if the side toolbar panel is currently hovered and
69
+     * {false} otherwise.
70
+     */
71
+    isHovered() {
72
+        return $("#sideToolbarContainer:hover").length > 0;
73
+    },
74
+
75
+    /**
76
+     * Hides the side toolbar panel with a slide out animation.
69 77
      */
70 78
     hide() {
71 79
         $("#sideToolbarContainer")
@@ -73,7 +81,7 @@ const SideContainerToggler = {
73 81
     },
74 82
 
75 83
     /**
76
-     * Shows the extended toolbar panel with a slide in animation.
84
+     * Shows the side toolbar panel with a slide in animation.
77 85
      */
78 86
     show() {
79 87
         if (!this.isVisible())
@@ -81,6 +89,12 @@ const SideContainerToggler = {
81 89
                 .removeClass("slideOutExt").addClass("slideInExt");
82 90
     },
83 91
 
92
+    /**
93
+     * Hides the inner container given by the selector.
94
+     *
95
+     * @param {Object} containerSelector the jquery selector for the
96
+     * element to hide
97
+     */
84 98
     hideInnerContainer(containerSelector) {
85 99
         containerSelector.removeClass("show").addClass("hide");
86 100
 
@@ -88,6 +102,12 @@ const SideContainerToggler = {
88 102
             containerSelector.attr('id'), false);
89 103
     },
90 104
 
105
+    /**
106
+     * Shows the inner container given by the selector.
107
+     *
108
+     * @param {Object} containerSelector the jquery selector for the
109
+     * element to show
110
+     */
91 111
     showInnerContainer(containerSelector) {
92 112
         containerSelector.removeClass("hide").addClass("show");
93 113
 

+ 30
- 10
modules/UI/toolbars/Toolbar.js View File

@@ -298,8 +298,7 @@ const Toolbar = {
298 298
 
299 299
         APP.UI.addListener(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
300 300
             function(containerId, isVisible) {
301
-                console.log("TOGGLED", containerId, isVisible);
302
-                Toolbar.handleSideToolbarContainerToggled(  containerId,
301
+                Toolbar._handleSideToolbarContainerToggled(  containerId,
303 302
                                                             isVisible);
304 303
             });
305 304
     },
@@ -544,7 +543,7 @@ const Toolbar = {
544 543
             return true;
545 544
         if ($("#bottomToolbar:hover").length > 0
546 545
             || $("#extendedToolbar:hover").length > 0
547
-            || SideContainerToggler.isVisible()) {
546
+            || SideContainerToggler.isHovered()) {
548 547
             return true;
549 548
         }
550 549
         return false;
@@ -564,8 +563,16 @@ const Toolbar = {
564 563
      */
565 564
     hide() {
566 565
         this.toolbarSelector.toggleClass("slideInY").toggleClass("slideOutY");
567
-        this.extendedToolbarSelector.toggleClass("slideInX")
568
-            .toggleClass("slideOutX");
566
+
567
+        let slideInAnimation = (SideContainerToggler.isVisible)
568
+                                    ? "slideInExtX"
569
+                                    : "slideInX";
570
+        let slideOutAnimation = (SideContainerToggler.isVisible)
571
+                                    ? "slideOutExtX"
572
+                                    : "slideOutX";
573
+
574
+        this.extendedToolbarSelector.toggleClass(slideInAnimation)
575
+            .toggleClass(slideOutAnimation);
569 576
     },
570 577
 
571 578
     /**
@@ -576,17 +583,30 @@ const Toolbar = {
576 583
         if (this.toolbarSelector.hasClass("slideOutY"))
577 584
             this.toolbarSelector.toggleClass("slideOutY");
578 585
 
579
-        if (this.extendedToolbarSelector.hasClass("slideOutX"))
580
-            this.extendedToolbarSelector.toggleClass("slideOutX");
586
+        let slideInAnimation = (SideContainerToggler.isVisible)
587
+                                ? "slideInExtX"
588
+                                : "slideInX";
589
+        let slideOutAnimation = (SideContainerToggler.isVisible)
590
+                                ? "slideOutExtX"
591
+                                : "slideOutX";
592
+
593
+        if (this.extendedToolbarSelector.hasClass(slideOutAnimation))
594
+            this.extendedToolbarSelector.toggleClass(slideOutAnimation);
581 595
 
582 596
         this.toolbarSelector.toggleClass("slideInY");
583
-        this.extendedToolbarSelector.toggleClass("slideInX");
597
+        this.extendedToolbarSelector.toggleClass(slideInAnimation);
598
+    },
599
+
600
+    registerClickListeners(listener) {
601
+        $('#mainToolbarContainer').click(listener);
602
+
603
+        $("#extendedToolbar").click(listener);
584 604
     },
585 605
 
586 606
     /**
587
-     *
607
+     * Handles the side toolbar toggle.
588 608
      */
589
-    handleSideToolbarContainerToggled(containerId, isVisible) {
609
+    _handleSideToolbarContainerToggled(containerId, isVisible) {
590 610
         Object.keys(defaultToolbarButtons).forEach(
591 611
             id => {
592 612
                 if (!UIUtil.isButtonEnabled(id))

+ 27
- 2
modules/UI/toolbars/ToolbarToggler.js View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 import UIUtil from '../util/UIUtil';
4 4
 import Toolbar from './Toolbar';
5
+import SideContainerToggler from "../side_pannels/SideContainerToggler";
5 6
 import FilmStrip from '../videolayout/FilmStrip.js';
6 7
 
7 8
 let toolbarTimeoutObject;
@@ -22,8 +23,11 @@ function showDesktopSharingButton() {
22 23
 
23 24
 /**
24 25
  * Hides the toolbar.
26
+ *
27
+ * @param force {true} to force the hiding of the toolbar without caring about
28
+ * the extended toolbar side panels.
25 29
  */
26
-function hideToolbar() {
30
+function hideToolbar(force) {
27 31
     if (alwaysVisibleToolbar) {
28 32
         return;
29 33
     }
@@ -33,7 +37,7 @@ function hideToolbar() {
33 37
 
34 38
     if (Toolbar.isHovered()) {
35 39
         toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
36
-    } else {
40
+    } else if (!SideContainerToggler.isVisible() || force) {
37 41
         Toolbar.hide();
38 42
         $('#subject').animate({top: "-=40"}, 300);
39 43
     }
@@ -45,7 +49,26 @@ const ToolbarToggler = {
45 49
      */
46 50
     init() {
47 51
         alwaysVisibleToolbar = (config.alwaysVisibleToolbar === true);
52
+
53
+        this._registerWindowClickListeners();
54
+    },
55
+
56
+    /**
57
+     * Registers click listeners handling the show and hode of toolbars when
58
+     * user clicks outside of toolbar area.
59
+     */
60
+    _registerWindowClickListeners() {
61
+        $(window).click(function() {
62
+            (Toolbar.isEnabled() && Toolbar.isVisible())
63
+                ? hideToolbar(true)
64
+                : this.showToolbar();
65
+        }.bind(this));
66
+
67
+        Toolbar.registerClickListeners(function(event){
68
+            event.stopPropagation();
69
+        });
48 70
     },
71
+
49 72
     /**
50 73
      * Sets the value of alwaysVisibleToolbar variable.
51 74
      * @param value {boolean} the new value of alwaysVisibleToolbar variable
@@ -53,12 +76,14 @@ const ToolbarToggler = {
53 76
     setAlwaysVisibleToolbar(value) {
54 77
         alwaysVisibleToolbar = value;
55 78
     },
79
+
56 80
     /**
57 81
      * Resets the value of alwaysVisibleToolbar variable to the default one.
58 82
      */
59 83
     resetAlwaysVisibleToolbar() {
60 84
         alwaysVisibleToolbar = (config.alwaysVisibleToolbar === true);
61 85
     },
86
+
62 87
     /**
63 88
      * Shows the main toolbar.
64 89
      */

Loading…
Cancel
Save