Browse Source

ref(toolbar): remove old recording button logic

master
Leonard Kim 7 years ago
parent
commit
fe473bf426
2 changed files with 2 additions and 51 deletions
  1. 0
    2
      modules/UI/UI.js
  2. 2
    49
      modules/UI/recording/Recording.js

+ 0
- 2
modules/UI/UI.js View File

530
 UI.updateLocalRole = isModerator => {
530
 UI.updateLocalRole = isModerator => {
531
     VideoLayout.showModeratorIndicator();
531
     VideoLayout.showModeratorIndicator();
532
 
532
 
533
-    Recording.showRecordingButton(isModerator);
534
-
535
     if (isModerator) {
533
     if (isModerator) {
536
         if (!interfaceConfig.DISABLE_FOCUS_INDICATOR) {
534
         if (!interfaceConfig.DISABLE_FOCUS_INDICATOR) {
537
             messageHandler.participantNotification(
535
             messageHandler.participantNotification(

+ 2
- 49
modules/UI/recording/Recording.js View File

1
-/* global APP, $, config, interfaceConfig */
1
+/* global APP, config, interfaceConfig */
2
 /*
2
 /*
3
  * Copyright @ 2015 Atlassian Pty Ltd
3
  * Copyright @ 2015 Atlassian Pty Ltd
4
  *
4
  *
192
 
192
 
193
 /**
193
 /**
194
  * Manages the recording user interface and user experience.
194
  * Manages the recording user interface and user experience.
195
- * @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
196
- * updateRecordingUI, checkAutoRecord}}
195
+ * @type {{init, updateRecordingState, updateRecordingUI, checkAutoRecord}}
197
  */
196
  */
198
 const Recording = {
197
 const Recording = {
199
     /**
198
     /**
215
             Object.assign(this, RECORDING_TRANSLATION_KEYS);
214
             Object.assign(this, RECORDING_TRANSLATION_KEYS);
216
         }
215
         }
217
 
216
 
218
-        // XXX Due to the React-ification of Toolbox, the HTMLElement with id
219
-        // toolbar_button_record may not exist yet.
220
-        $(document).on(
221
-            'click',
222
-            '#toolbar_button_record',
223
-            ev => this._onToolbarButtonClick(ev));
224
-
225
         this.eventEmitter.on(UIEvents.TOGGLE_RECORDING,
217
         this.eventEmitter.on(UIEvents.TOGGLE_RECORDING,
226
             () => this._onToolbarButtonClick());
218
             () => this._onToolbarButtonClick());
227
 
219
 
242
         }
234
         }
243
     },
235
     },
244
 
236
 
245
-    /**
246
-     * Initialise the recording button.
247
-     */
248
-    initRecordingButton() {
249
-        const selector = $('#toolbar_button_record');
250
-
251
-        selector.addClass(this.baseClass);
252
-        selector.attr('data-i18n', `[content]${this.recordingButtonTooltip}`);
253
-        APP.translation.translateElement(selector);
254
-    },
255
-
256
-    /**
257
-     * Shows or hides the 'recording' button.
258
-     * @param show {true} to show the recording button, {false} to hide it
259
-     */
260
-    showRecordingButton(show) {
261
-        const shouldShow = show && _isRecordingButtonEnabled();
262
-        const id = 'toolbar_button_record';
263
-
264
-        UIUtil.setVisible(id, shouldShow);
265
-    },
266
-
267
     /**
237
     /**
268
      * Updates the recording state UI.
238
      * Updates the recording state UI.
269
      * @param recordingState gives us the current recording state
239
      * @param recordingState gives us the current recording state
304
                 showSpinner: recordingState === JitsiRecordingStatus.RETRYING
274
                 showSpinner: recordingState === JitsiRecordingStatus.RETRYING
305
             };
275
             };
306
 
276
 
307
-            this._setToolbarButtonToggled(true);
308
             isRecording = true;
277
             isRecording = true;
309
 
278
 
310
             break;
279
             break;
330
                     : this.recordingOffKey
299
                     : this.recordingOffKey
331
             };
300
             };
332
 
301
 
333
-            this._setToolbarButtonToggled(false);
334
-
335
             setTimeout(() => {
302
             setTimeout(() => {
336
                 APP.store.dispatch(hideRecordingLabel());
303
                 APP.store.dispatch(hideRecordingLabel());
337
             }, 5000);
304
             }, 5000);
345
                 key: this.recordingPendingKey
312
                 key: this.recordingPendingKey
346
             };
313
             };
347
 
314
 
348
-            this._setToolbarButtonToggled(false);
349
-
350
             break;
315
             break;
351
         }
316
         }
352
 
317
 
356
                 key: this.recordingErrorKey
321
                 key: this.recordingErrorKey
357
             };
322
             };
358
 
323
 
359
-            this._setToolbarButtonToggled(false);
360
-
361
             break;
324
             break;
362
         }
325
         }
363
 
326
 
488
             });
451
             });
489
         }
452
         }
490
         }
453
         }
491
-    },
492
-
493
-    /**
494
-     * Sets the toggled state of the recording toolbar button.
495
-     *
496
-     * @param {boolean} isToggled indicates if the button should be toggled
497
-     * or not
498
-     */
499
-    _setToolbarButtonToggled(isToggled) {
500
-        $('#toolbar_button_record').toggleClass('toggled', isToggled);
501
     }
454
     }
502
 };
455
 };
503
 
456
 

Loading…
Cancel
Save