Browse Source

Filmstrip is extended with "Hide" button

j8
Maxim Voloshin 8 years ago
parent
commit
dc93940bbd
2 changed files with 76 additions and 2 deletions
  1. 36
    2
      css/_videolayout_default.scss
  2. 40
    0
      modules/UI/videolayout/FilmStrip.js

+ 36
- 2
css/_videolayout_default.scss View File

@@ -25,9 +25,8 @@
25 25
     position:absolute;
26 26
     text-align:right;
27 27
     height:196px;
28
-    padding: 10px 10px 10px 5px;
28
+    padding: 10px 10px 17px 5px;
29 29
     bottom: 0;
30
-    left: 0;
31 30
     right: 0;
32 31
     width:auto;
33 32
     border: 2px solid transparent;
@@ -603,4 +602,39 @@
603 602
 
604 603
 .moveToCorner + .moveToCorner {
605 604
     right: 80px;
605
+}
606
+
607
+.filmstripToolbar {
608
+    width: 20px;
609
+    position: absolute;
610
+    right: 4px;
611
+    bottom: 20px;
612
+    z-index: 6;
613
+
614
+    button {
615
+        font-size: 14px;
616
+        line-height: 1.2;
617
+        text-align: center;
618
+        background: transparent;
619
+        opacity: 0.7;
620
+        height: auto;
621
+        width: 100%;
622
+        padding: 0;
623
+        margin: 0 1px;
624
+        border: none;
625
+
626
+        -webkit-appearance: none;
627
+
628
+        &:hover {
629
+            opacity: 1;
630
+        }
631
+
632
+        i {
633
+            cursor: pointer;
634
+        }
635
+    }
636
+}
637
+
638
+.filmstripToolbar + #remoteVideos {
639
+    padding-right: 24px;
606 640
 }

+ 40
- 0
modules/UI/videolayout/FilmStrip.js View File

@@ -12,6 +12,46 @@ const FilmStrip = {
12 12
     init (eventEmitter) {
13 13
         this.filmStrip = $('#remoteVideos');
14 14
         this.eventEmitter = eventEmitter;
15
+        this.filmStripIsVisible = true;
16
+        this.renderFilmstripToolbar();
17
+        this.activateHideButton();
18
+    },
19
+
20
+    /**
21
+     * Attach 'click' listener to "hide filmstrip" button
22
+     */
23
+    activateHideButton () {
24
+        $('#videospace').on('click', '#hideVideoToolbar', () => {
25
+            var icon = document.querySelector('#hideVideoToolbar i');
26
+
27
+            this.filmStripIsVisible = !this.filmStripIsVisible;
28
+            this.toggleFilmStrip(this.filmStripIsVisible);
29
+
30
+            icon.classList.remove(
31
+                this.filmStripIsVisible ? 'icon-menu-up' : 'icon-menu-down');
32
+            icon.classList.add(
33
+                this.filmStripIsVisible ? 'icon-menu-down' : 'icon-menu-up');
34
+        });
35
+    },
36
+
37
+    /**
38
+     * Shows toolbar on the right of the filmstrip
39
+     */
40
+    renderFilmstripToolbar () {
41
+        // create toolbar
42
+        var container = document.createElement('div');
43
+        container.className = 'filmstripToolbar';
44
+
45
+        container.innerHTML = `
46
+            <button id="hideVideoToolbar">
47
+                <i class="icon-menu-${this.filmStripIsVisible ? 'down' : 'up'}">
48
+                </i>
49
+            </button>
50
+        `;
51
+
52
+        // show toolbar
53
+        document.querySelector('#videospace')
54
+            .insertBefore(container, document.querySelector('#remoteVideos'));
15 55
     },
16 56
 
17 57
     /**

Loading…
Cancel
Save