Kaynağa Gözat

Fixes side toolbar container behavior

master
yanas 9 yıl önce
ebeveyn
işleme
50e803f1a0

+ 5
- 0
css/_contact_list.scss Dosyayı Görüntüle

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

+ 29
- 9
css/_toolbars.scss Dosyayı Görüntüle

79
     position:absolute;
79
     position:absolute;
80
     top: 0px;
80
     top: 0px;
81
     left: $defaultToolbarSize;
81
     left: $defaultToolbarSize;
82
-    width:0%;
82
+    width: 0%;
83
     height: 100%;
83
     height: 100%;
84
     max-width: 200px;
84
     max-width: 200px;
85
     background-color: rgba(0,0,0,0.8);
85
     background-color: rgba(0,0,0,0.8);
145
 a.button.selected {
145
 a.button.selected {
146
     cursor: pointer;
146
     cursor: pointer;
147
     // sum opacity with background layer should give us 0.8
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
 a.button>#avatar {
151
 a.button>#avatar {
163
  * START of slide in animation for extended toolbar.
163
  * START of slide in animation for extended toolbar.
164
  */
164
  */
165
 @include keyframes(slideInX) {
165
 @include keyframes(slideInX) {
166
-    100% { transform: translateX(0%); }
166
+  0% { transform: translateX(-100%); }
167
+  100% { transform: translateX(0%); }
167
 }
168
 }
168
 
169
 
169
 .slideInX {
170
 .slideInX {
171
 }
172
 }
172
 
173
 
173
 @include keyframes(slideOutX) {
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
 .slideOutX {
179
 .slideOutX {
179
   @include animation('slideOutX .5s forwards');
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
  * END of slide out animation for extended toolbar.
202
  * END of slide out animation for extended toolbar.
183
  */
203
  */
209
  * START of slide in animation for extended toolbar panel.
229
  * START of slide in animation for extended toolbar panel.
210
  */
230
  */
211
 @include keyframes(slideInExt) {
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
 .slideInExt {
236
 .slideInExt {
218
 }
238
 }
219
 
239
 
220
 @include keyframes(slideOutExt) {
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
 .slideOutExt {
245
 .slideOutExt {

+ 5
- 0
css/_variables.scss Dosyayı Görüntüle

8
  */
8
  */
9
 $defaultToolbarSize: 50px;
9
 $defaultToolbarSize: 50px;
10
 
10
 
11
+/**
12
+ * Miscellaneous.
13
+ */
14
+$toolbarSelectBackground: rgba(0, 0, 0, 0.6);
15
+

+ 65
- 65
index.html Dosyayı Görüntüle

116
                 </span>
116
                 </span>
117
         </div>
117
         </div>
118
         <div id="subject" class="hide"></div>
118
         <div id="subject" class="hide"></div>
119
-        <span id="extendedToolbar" class="toolbar">
119
+        <div id="extendedToolbar" class="toolbar">
120
             <a class="button" data-container="body" data-placement="right" data-i18n="[content]toolbar.profile" content="Edit your profile">
120
             <a class="button" data-container="body" data-placement="right" data-i18n="[content]toolbar.profile" content="Edit your profile">
121
                 <img id="avatar" src="images/avatar2.png"/>
121
                 <img id="avatar" src="images/avatar2.png"/>
122
             </a>
122
             </a>
133
                     </li>
133
                     </li>
134
                 </ul>
134
                 </ul>
135
             </span>
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
             <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
             <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
                 <span id="numberOfParticipants"></span>
138
                 <span id="numberOfParticipants"></span>
138
             </a>
139
             </a>
141
             </a>
142
             </a>
142
             <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="right" style="display: none"></a>
143
             <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="right" style="display: none"></a>
143
             <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-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
             <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>
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
             <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">
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
                 <ul id="sharedVideoMutedPopup" class="loginmenu">
147
                 <ul id="sharedVideoMutedPopup" class="loginmenu">
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>
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
             <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>
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
             <a class="button fa fa-heart" id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]feedback"></a>
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
         <div id="videospace">
218
         <div id="videospace">
158
             <div id="largeVideoContainer" class="videocontainer">
219
             <div id="largeVideoContainer" class="videocontainer">
159
                 <div id="presentation"></div>
220
                 <div id="presentation"></div>
169
                     <canvas id="dominantSpeakerAudioLevel"></canvas>
230
                     <canvas id="dominantSpeakerAudioLevel"></canvas>
170
                 </div>
231
                 </div>
171
                 <div id="largeVideoWrapper">
232
                 <div id="largeVideoWrapper">
172
-                    <video id="largeVideo" muted="true" autoplay></video>
233
+                    <video id="largeVideo" muted="true" preload="auto" autoplay></video>
173
                 </div>
234
                 </div>
174
                 <span id="videoConnectionMessage"></span>
235
                 <span id="videoConnectionMessage"></span>
175
                 <span id="videoResolutionLabel">HD</span>
236
                 <span id="videoResolutionLabel">HD</span>
191
                 <audio id="userLeft" src="sounds/left.wav" preload="auto"></audio>
252
                 <audio id="userLeft" src="sounds/left.wav" preload="auto"></audio>
192
             </div>
253
             </div>
193
         </div>
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
     </div>
255
     </div>
256
     <div id="keyboard-shortcuts" class="keyboard-shortcuts" style="display:none;">
256
     <div id="keyboard-shortcuts" class="keyboard-shortcuts" style="display:none;">
257
         <div class="header"><h3 data-i18n="keyboardShortcuts.keyboardShortcuts"></h3></div>
257
         <div class="header"><h3 data-i18n="keyboardShortcuts.keyboardShortcuts"></h3></div>

+ 23
- 3
modules/UI/side_pannels/SideContainerToggler.js Dosyayı Görüntüle

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
      * otherwise returns {false}.
61
      * otherwise returns {false}.
62
      */
62
      */
63
     isVisible() {
63
     isVisible() {
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
     hide() {
78
     hide() {
71
         $("#sideToolbarContainer")
79
         $("#sideToolbarContainer")
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
     show() {
86
     show() {
79
         if (!this.isVisible())
87
         if (!this.isVisible())
81
                 .removeClass("slideOutExt").addClass("slideInExt");
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
     hideInnerContainer(containerSelector) {
98
     hideInnerContainer(containerSelector) {
85
         containerSelector.removeClass("show").addClass("hide");
99
         containerSelector.removeClass("show").addClass("hide");
86
 
100
 
88
             containerSelector.attr('id'), false);
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
     showInnerContainer(containerSelector) {
111
     showInnerContainer(containerSelector) {
92
         containerSelector.removeClass("hide").addClass("show");
112
         containerSelector.removeClass("hide").addClass("show");
93
 
113
 

+ 30
- 10
modules/UI/toolbars/Toolbar.js Dosyayı Görüntüle

298
 
298
 
299
         APP.UI.addListener(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
299
         APP.UI.addListener(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
300
             function(containerId, isVisible) {
300
             function(containerId, isVisible) {
301
-                console.log("TOGGLED", containerId, isVisible);
302
-                Toolbar.handleSideToolbarContainerToggled(  containerId,
301
+                Toolbar._handleSideToolbarContainerToggled(  containerId,
303
                                                             isVisible);
302
                                                             isVisible);
304
             });
303
             });
305
     },
304
     },
544
             return true;
543
             return true;
545
         if ($("#bottomToolbar:hover").length > 0
544
         if ($("#bottomToolbar:hover").length > 0
546
             || $("#extendedToolbar:hover").length > 0
545
             || $("#extendedToolbar:hover").length > 0
547
-            || SideContainerToggler.isVisible()) {
546
+            || SideContainerToggler.isHovered()) {
548
             return true;
547
             return true;
549
         }
548
         }
550
         return false;
549
         return false;
564
      */
563
      */
565
     hide() {
564
     hide() {
566
         this.toolbarSelector.toggleClass("slideInY").toggleClass("slideOutY");
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
         if (this.toolbarSelector.hasClass("slideOutY"))
583
         if (this.toolbarSelector.hasClass("slideOutY"))
577
             this.toolbarSelector.toggleClass("slideOutY");
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
         this.toolbarSelector.toggleClass("slideInY");
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
         Object.keys(defaultToolbarButtons).forEach(
610
         Object.keys(defaultToolbarButtons).forEach(
591
             id => {
611
             id => {
592
                 if (!UIUtil.isButtonEnabled(id))
612
                 if (!UIUtil.isButtonEnabled(id))

+ 27
- 2
modules/UI/toolbars/ToolbarToggler.js Dosyayı Görüntüle

2
 
2
 
3
 import UIUtil from '../util/UIUtil';
3
 import UIUtil from '../util/UIUtil';
4
 import Toolbar from './Toolbar';
4
 import Toolbar from './Toolbar';
5
+import SideContainerToggler from "../side_pannels/SideContainerToggler";
5
 import FilmStrip from '../videolayout/FilmStrip.js';
6
 import FilmStrip from '../videolayout/FilmStrip.js';
6
 
7
 
7
 let toolbarTimeoutObject;
8
 let toolbarTimeoutObject;
22
 
23
 
23
 /**
24
 /**
24
  * Hides the toolbar.
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
     if (alwaysVisibleToolbar) {
31
     if (alwaysVisibleToolbar) {
28
         return;
32
         return;
29
     }
33
     }
33
 
37
 
34
     if (Toolbar.isHovered()) {
38
     if (Toolbar.isHovered()) {
35
         toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
39
         toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
36
-    } else {
40
+    } else if (!SideContainerToggler.isVisible() || force) {
37
         Toolbar.hide();
41
         Toolbar.hide();
38
         $('#subject').animate({top: "-=40"}, 300);
42
         $('#subject').animate({top: "-=40"}, 300);
39
     }
43
     }
45
      */
49
      */
46
     init() {
50
     init() {
47
         alwaysVisibleToolbar = (config.alwaysVisibleToolbar === true);
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
      * Sets the value of alwaysVisibleToolbar variable.
73
      * Sets the value of alwaysVisibleToolbar variable.
51
      * @param value {boolean} the new value of alwaysVisibleToolbar variable
74
      * @param value {boolean} the new value of alwaysVisibleToolbar variable
53
     setAlwaysVisibleToolbar(value) {
76
     setAlwaysVisibleToolbar(value) {
54
         alwaysVisibleToolbar = value;
77
         alwaysVisibleToolbar = value;
55
     },
78
     },
79
+
56
     /**
80
     /**
57
      * Resets the value of alwaysVisibleToolbar variable to the default one.
81
      * Resets the value of alwaysVisibleToolbar variable to the default one.
58
      */
82
      */
59
     resetAlwaysVisibleToolbar() {
83
     resetAlwaysVisibleToolbar() {
60
         alwaysVisibleToolbar = (config.alwaysVisibleToolbar === true);
84
         alwaysVisibleToolbar = (config.alwaysVisibleToolbar === true);
61
     },
85
     },
86
+
62
     /**
87
     /**
63
      * Shows the main toolbar.
88
      * Shows the main toolbar.
64
      */
89
      */

Loading…
İptal
Kaydet