소스 검색

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

+ 9
- 4
modules/UI/invite/InviteDialogView.js 파일 보기

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

Loading…
취소
저장