浏览代码

Merge pull request #885 from jitsi/add-raise-hand-toggle

Adds raise hand toggle state.
master
Дамян Минков 8 年前
父节点
当前提交
f0a898c674
共有 6 个文件被更改,包括 34 次插入0 次删除
  1. 2
    0
      conference.js
  2. 4
    0
      css/_toolbars.scss
  3. 1
    0
      css/_variables.scss
  4. 10
    0
      modules/UI/UI.js
  5. 12
    0
      modules/UI/toolbars/Toolbar.js
  6. 5
    0
      service/UI/UIEvents.js

+ 2
- 0
conference.js 查看文件

@@ -1648,6 +1648,8 @@ export default {
1648 1648
     setRaisedHand(raisedHand) {
1649 1649
         if (raisedHand !== this.isHandRaised)
1650 1650
         {
1651
+            APP.UI.onLocalRaiseHandChanged(raisedHand);
1652
+
1651 1653
             this.isHandRaised = raisedHand;
1652 1654
             // Advertise the updated status
1653 1655
             room.setLocalParticipantProperty("raisedHand", raisedHand);

+ 4
- 0
css/_toolbars.scss 查看文件

@@ -118,6 +118,10 @@
118 118
     cursor: default;
119 119
 }
120 120
 
121
+.button.toggled {
122
+    color: $toolbarButtonToggled;
123
+}
124
+
121 125
 a.button.unclickable:hover,
122 126
 a.button.unclickable:active,
123 127
 a.button.unclickable.selected{

+ 1
- 0
css/_variables.scss 查看文件

@@ -25,6 +25,7 @@ $defaultBackground: #474747;
25 25
 
26 26
 // Toolbar
27 27
 $toolbarSelectBackground: rgba(0, 0, 0, .6);
28
+$toolbarButtonToggled: #44A5FF;
28 29
 
29 30
 // Main controls
30 31
 $inputBackground: rgba(132, 132, 132, .5);

+ 10
- 0
modules/UI/UI.js 查看文件

@@ -1211,6 +1211,16 @@ UI.onStartMutedChanged = function (startAudioMuted, startVideoMuted) {
1211 1211
     SettingsMenu.updateStartMutedBox(startAudioMuted, startVideoMuted);
1212 1212
 };
1213 1213
 
1214
+/**
1215
+ * Notifies interested listeners that the raise hand property has changed.
1216
+ *
1217
+ * @param {boolean} isRaisedHand indicates the current state of the
1218
+ * "raised hand"
1219
+ */
1220
+UI.onLocalRaiseHandChanged = function (isRaisedHand) {
1221
+    eventEmitter.emit(UIEvents.LOCAL_RAISE_HAND_CHANGED, isRaisedHand);
1222
+};
1223
+
1214 1224
 /**
1215 1225
  * Update list of available physical devices.
1216 1226
  * @param {object[]} devices new list of available devices

+ 12
- 0
modules/UI/toolbars/Toolbar.js 查看文件

@@ -400,6 +400,11 @@ const Toolbar = {
400 400
                                                             isVisible);
401 401
             });
402 402
 
403
+        APP.UI.addListener(UIEvents.LOCAL_RAISE_HAND_CHANGED,
404
+            function(isRaisedHand) {
405
+                Toolbar._toggleRaiseHand(isRaisedHand);
406
+            });
407
+
403 408
         if(!APP.tokenData.isGuest) {
404 409
             $("#toolbar_button_profile").addClass("unclickable");
405 410
         }
@@ -565,6 +570,13 @@ const Toolbar = {
565 570
         }
566 571
     },
567 572
 
573
+    /**
574
+     * Toggles / untoggles the view for raised hand.
575
+     */
576
+    _toggleRaiseHand(isRaisedHand) {
577
+        $('#toolbar_button_raisehand').toggleClass("toggled", isRaisedHand);
578
+    },
579
+
568 580
     /**
569 581
      * Marks video icon as muted or not.
570 582
      * @param {boolean} muted if icon should look like muted or not

+ 5
- 0
service/UI/UIEvents.js 查看文件

@@ -107,6 +107,11 @@ export default {
107 107
      */
108 108
     SIDE_TOOLBAR_CONTAINER_TOGGLED: "UI.side_container_toggled",
109 109
 
110
+    /**
111
+     * Notifies that the raise hand has been changed.
112
+     */
113
+    LOCAL_RAISE_HAND_CHANGED: "UI.local_raise_hand_changed",
114
+
110 115
     /**
111 116
      * Notifies that the avatar is displayed or not on the largeVideo.
112 117
      */

正在加载...
取消
保存