浏览代码

Merge pull request #1092 from jitsi/update-lock-state

Updates lock state
master
yanas 8 年前
父节点
当前提交
a5e7c86125
共有 2 个文件被更改,包括 12 次插入10 次删除
  1. 3
    6
      modules/UI/invite/Invite.js
  2. 9
    4
      modules/UI/invite/InviteDialogView.js

+ 3
- 6
modules/UI/invite/Invite.js 查看文件

@@ -40,9 +40,9 @@ class Invite {
40 40
 
41 41
         this.conference.on(ConferenceEvents.USER_ROLE_CHANGED, (id) => {
42 42
             if (APP.conference.isLocalId(id)
43
-                    && this.isModerator !== this.conference.isModerator) {
43
+                    && this.isModerator !== this.conference.isModerator()) {
44 44
 
45
-                this.setModerator(this.conference.isModerator);
45
+                this.setModerator(this.conference.isModerator());
46 46
             }
47 47
         });
48 48
 
@@ -116,7 +116,6 @@ class Invite {
116 116
      * creating view object using as a model this module
117 117
      */
118 118
     initDialog() {
119
-        this.password = this.getPassword();
120 119
         this.view = new InviteDialogView(this);
121 120
     }
122 121
 
@@ -191,10 +190,8 @@ class Invite {
191 190
      * @param isLocked
192 191
      */
193 192
     setLockedFromElsewhere(isLocked) {
194
-        // isLocked can be 1, true or false
195
-        let newLockState = (isLocked === 1) || isLocked;
196 193
         let oldLockState = this.roomLocker.isLocked;
197
-        if (oldLockState !== newLockState) {
194
+        if (oldLockState !== isLocked) {
198 195
             this.roomLocker.lockedElsewhere = isLocked;
199 196
             APP.UI.emitEvent(UIEvents.TOGGLE_ROOM_LOCK);
200 197
             this.updateView();

+ 9
- 4
modules/UI/invite/InviteDialogView.js 查看文件

@@ -177,7 +177,8 @@ export default class InviteDialogView {
177 177
      * @returns {string}
178 178
      */
179 179
     getPasswordBlock() {
180
-        let { password, isModerator } = this.model;
180
+        let password = this.model.getPassword();
181
+        let { isModerator } = this.model;
181 182
 
182 183
         if (isModerator) {
183 184
             return (`
@@ -321,13 +322,17 @@ export default class InviteDialogView {
321 322
      */
322 323
     updateView() {
323 324
         let pass = this.model.getPassword();
324
-        if (this.model.getRoomLocker().lockedElsewhere || !pass)
325
+        let { isModerator } = this.model;
326
+        if (this.model.getRoomLocker().lockedElsewhere || !pass) {
325 327
             $('#inviteDialogPassword').attr("data-i18n", "passwordSetRemotely");
326
-        else
328
+            APP.translation.translateElement($('#inviteDialogPassword'));
329
+        } else {
330
+            $('#inviteDialogPassword').removeAttr("data-i18n");
327 331
             $('#inviteDialogPassword').text(pass);
332
+        }
328 333
 
329 334
         // if we are not moderator we cannot remove password
330
-        if (APP.conference.isModerator)
335
+        if (isModerator)
331 336
             $('#inviteDialogRemovePassword').show();
332 337
         else
333 338
             $('#inviteDialogRemovePassword').hide();

正在加载...
取消
保存