Browse Source

fix(volume-slider): modify positioning so slider fits popup width

j8
Leonard Kim 8 years ago
parent
commit
258dc594dd
2 changed files with 29 additions and 11 deletions
  1. 21
    5
      css/_popup_menu.scss
  2. 8
    6
      modules/UI/videolayout/RemoteVideo.js

+ 21
- 5
css/_popup_menu.scss View File

@@ -41,21 +41,37 @@
41 41
         }
42 42
     }
43 43
 
44
-    &__text,
45
-    &__slider {
44
+    &__text {
46 45
         display: inline-block;
47 46
         vertical-align: middle;
48 47
     }
49 48
 
50
-    &__slider {
51
-        width: 50px;
49
+    &__contents {
50
+        display: flex;
51
+
52
+        /**
53
+         * Positioning styles on the slider and its container are used to make
54
+         * the container fit the popup width, by removing the slider from the
55
+         * page flow, and then making the slider fit the container.
56
+         */
57
+        .popupmenu__slider_container {
58
+            position: relative;
59
+            width: 100%;
60
+
61
+            .popupmenu__slider {
62
+                bottom: 50%;
63
+                position: absolute;
64
+                top: 50%;
65
+                width: 100%;
66
+            }
67
+        }
52 68
     }
53 69
 
54 70
     &__icon {
55 71
         vertical-align: middle;
56 72
         position: relative;
57 73
         display: inline-block;
58
-        width: 20px;
74
+        min-width: 20px;
59 75
         height: 100%;
60 76
         text-align: center;
61 77
 

+ 8
- 6
modules/UI/videolayout/RemoteVideo.js View File

@@ -375,12 +375,14 @@ RemoteVideo.prototype._generatePopupMenuSliderItem = function (options) {
375 375
         <span class='popupmenu__icon'>
376 376
             <i class=${options.icon}></i>
377 377
         </span>
378
-        <input class='popupmenu__slider'
379
-            type='range'
380
-            min='0'
381
-            max=${options.maxValue || 100}
382
-            value=${options.initialValue || 0}>
383
-        </input>
378
+        <div class='popupmenu__slider_container'>
379
+            <input class='popupmenu__slider'
380
+                type='range'
381
+                min='0'
382
+                max=${options.maxValue || 100}
383
+                value=${options.initialValue || 0}>
384
+            </input>
385
+        </div>
384 386
     </div>`;
385 387
 
386 388
     const menuItem = document.createElement('li');

Loading…
Cancel
Save