Pārlūkot izejas kodu

Move the display name to the center

j8
yanas 8 gadus atpakaļ
vecāks
revīzija
3fe43abdea

+ 4
- 3
css/_videolayout_default.scss Parādīt failu

@@ -67,7 +67,6 @@
67 67
     box-sizing: border-box; // Includes the padding in the 100% width.
68 68
     height: $thumbnailToolbarHeight;
69 69
     max-height: 100%;
70
-    background-color: rgba(0, 0, 0, 0.5);
71 70
     padding: 0 5px 0 5px;
72 71
 }
73 72
 
@@ -176,8 +175,10 @@
176 175
 .videocontainer .editdisplayname {
177 176
     display: inline-block;
178 177
     position: absolute;
179
-    left: 30%;
180
-    width: 40%;
178
+    left: 10%;
179
+    width: 80%;
180
+    top: 50%;
181
+    margin-top: -12px;
181 182
     color: $participantNameColor;
182 183
     text-align: center;
183 184
     text-overflow: ellipsis;

+ 12
- 0
modules/UI/util/UIUtil.js Parādīt failu

@@ -237,6 +237,18 @@ const TOOLTIP_POSITIONS = {
237 237
         $("#"+id).addClass("hide");
238 238
     },
239 239
 
240
+    /**
241
+     * Shows / hides the element with the given jQuery selector.
242
+     *
243
+     * @param {jQuery} selector the jQuery selector of the element to show/hide
244
+     * @param {boolean} isVisible
245
+     */
246
+    setVisibility(selector, isVisible) {
247
+        if (selector && selector.length > 0) {
248
+            selector.css("visibility", isVisible ? "visible" : "hidden");
249
+        }
250
+    },
251
+
240 252
     hideDisabledButtons: function (mappings) {
241 253
         var selector = Object.keys(mappings)
242 254
           .map(function (buttonName) {

+ 0
- 1
modules/UI/videolayout/LocalVideo.js Parādīt failu

@@ -70,7 +70,6 @@ LocalVideo.prototype.setDisplayName = function(displayName) {
70 70
         nameSpan = document.createElement('span');
71 71
         nameSpan.className = 'displayname';
72 72
         document.getElementById(this.videoSpanId)
73
-            .querySelector('.videocontainer__toolbar')
74 73
             .appendChild(nameSpan);
75 74
 
76 75
 

+ 3
- 7
modules/UI/videolayout/RemoteVideo.js Parādīt failu

@@ -512,9 +512,10 @@ RemoteVideo.prototype.hideConnectionIndicator = function () {
512 512
 
513 513
 /**
514 514
  * Sets the display name for the given video span id.
515
+ *
516
+ * @param displayName the display name to set
515 517
  */
516
-RemoteVideo.prototype.setDisplayName = function(displayName, key) {
517
-
518
+RemoteVideo.prototype.setDisplayName = function(displayName) {
518 519
     if (!this.container) {
519 520
         console.warn( "Unable to set displayName - " + this.videoSpanId +
520 521
                 " does not exist");
@@ -530,10 +531,6 @@ RemoteVideo.prototype.setDisplayName = function(displayName, key) {
530 531
             if (displaynameSpan.text() !== displayName)
531 532
                 displaynameSpan.text(displayName);
532 533
         }
533
-        else if (key && key.length > 0) {
534
-            var nameHtml = APP.translation.generateTranslationHTML(key);
535
-            $('#' + this.videoSpanId + '_name').html(nameHtml);
536
-        }
537 534
         else
538 535
             $('#' + this.videoSpanId + '_name').text(
539 536
                 interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);
@@ -541,7 +538,6 @@ RemoteVideo.prototype.setDisplayName = function(displayName, key) {
541 538
         nameSpan = document.createElement('span');
542 539
         nameSpan.className = 'displayname';
543 540
         $('#' + this.videoSpanId)[0]
544
-            .querySelector('.videocontainer__toolbar')
545 541
             .appendChild(nameSpan);
546 542
 
547 543
         if (displayName && displayName.length > 0) {

+ 19
- 10
modules/UI/videolayout/SmallVideo.js Parādīt failu

@@ -36,12 +36,6 @@ function SmallVideo(VideoLayout) {
36 36
     this.VideoLayout = VideoLayout;
37 37
 }
38 38
 
39
-function setVisibility(selector, show) {
40
-    if (selector && selector.length > 0) {
41
-        selector.css("visibility", show ? "visible" : "hidden");
42
-    }
43
-}
44
-
45 39
 /**
46 40
  * Returns the identifier of this small video.
47 41
  *
@@ -395,6 +389,16 @@ SmallVideo.prototype.$avatar = function () {
395 389
     return $('#' + this.videoSpanId + ' .userAvatar');
396 390
 };
397 391
 
392
+/**
393
+ * Returns the display name element, which appears on the video thumbnail.
394
+ *
395
+ * @return {jQuery} a jQuery selector pointing to the display name element of
396
+ * the video thumbnail
397
+ */
398
+SmallVideo.prototype.$displayName = function () {
399
+    return $('#' + this.videoSpanId + ' .displayname');
400
+};
401
+
398 402
 /**
399 403
  * Enables / disables the css responsible for focusing/pinning a video
400 404
  * thumbnail.
@@ -479,10 +483,15 @@ SmallVideo.prototype.updateView = function () {
479 483
 
480 484
     // Determine whether video, avatar or blackness should be displayed
481 485
     let displayMode = this.selectDisplayMode();
482
-    // Show/hide video
483
-    setVisibility(this.selectVideoElement(), displayMode === DISPLAY_VIDEO);
484
-    // Show/hide the avatar
485
-    setVisibility(this.$avatar(), displayMode === DISPLAY_AVATAR);
486
+    // Show/hide video.
487
+    UIUtil.setVisibility(   this.selectVideoElement(),
488
+                            displayMode === DISPLAY_VIDEO);
489
+    // Show/hide the avatar.
490
+    UIUtil.setVisibility(   this.$avatar(),
491
+                            displayMode === DISPLAY_AVATAR);
492
+    // Show/hide the display name.
493
+    UIUtil.setVisibility(   this.$displayName(),
494
+                            displayMode === DISPLAY_BLACKNESS);
486 495
 };
487 496
 
488 497
 SmallVideo.prototype.avatarChanged = function (avatarUrl) {

Notiek ielāde…
Atcelt
Saglabāt