Browse Source

Merge pull request #1135 from BeatC/fix-js-from-styles-editions

Editions to "clean css from js"
master
yanas 9 years ago
parent
commit
b2577090bd

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

387
      * @param show {true} to show the recording button, {false} to hide it
387
      * @param show {true} to show the recording button, {false} to hide it
388
      */
388
      */
389
     showRecordingButton (show) {
389
     showRecordingButton (show) {
390
-        let isVisible = show && _isRecordingButtonEnabled();
390
+        let shouldShow = show && _isRecordingButtonEnabled();
391
         let id = 'toolbar_button_record';
391
         let id = 'toolbar_button_record';
392
 
392
 
393
-        console.log('recording is visible', isVisible);
394
-
395
-        if (isVisible) {
393
+        if (shouldShow) {
396
             UIUtil.showElement(id);
394
             UIUtil.showElement(id);
397
         } else {
395
         } else {
398
             UIUtil.hideElement(id);
396
             UIUtil.hideElement(id);
485
         } else {
483
         } else {
486
             UIUtil.hideElement(spinnerId);
484
             UIUtil.hideElement(spinnerId);
487
         }
485
         }
488
-
489
-        document.querySelector('#recordingSpinner').classList
490
-                .toggle('show-inline', recordingState === Status.RETRYING);
491
     },
486
     },
492
     // checks whether recording is enabled and whether we have params
487
     // checks whether recording is enabled and whether we have params
493
     // to start automatically recording
488
     // to start automatically recording

+ 3
- 3
modules/UI/side_pannels/chat/Chat.js View File

296
         let toggleFunction;
296
         let toggleFunction;
297
         if (subject) {
297
         if (subject) {
298
             subject = subject.trim();
298
             subject = subject.trim();
299
-            toggleFunction = UIUtil.showElement.bind(UIUtil);
300
-        } else {
301
-            toggleFunction = UIUtil.hideElement.bind(UIUtil);
302
         }
299
         }
303
 
300
 
301
+        toggleFunction = subject ? UIUtil.showElement : UIUtil.hideElement;
302
+        toggleFunction = toggleFunction.bind(UIUtil);
303
+
304
         let subjectId = 'subject';
304
         let subjectId = 'subject';
305
         let html = linkify(UIUtil.escapeHtml(subject));
305
         let html = linkify(UIUtil.escapeHtml(subject));
306
         $(`#${subjectId}`).html(html);
306
         $(`#${subjectId}`).html(html);

+ 4
- 3
modules/UI/util/UIUtil.js View File

241
             element.classList.remove('hide');
241
             element.classList.remove('hide');
242
         }
242
         }
243
 
243
 
244
-        let type = this.getElementDefaultDisplay(element.tagName);
244
+        let type = this._getElementDefaultDisplay(element.tagName);
245
         let className = SHOW_CLASSES[type];
245
         let className = SHOW_CLASSES[type];
246
         element.classList.add(className);
246
         element.classList.add(className);
247
     },
247
     },
263
             return;
263
             return;
264
         }
264
         }
265
 
265
 
266
-        let type = this.getElementDefaultDisplay(element.tagName);
266
+        let type = this._getElementDefaultDisplay(element.tagName);
267
         let className = SHOW_CLASSES[type];
267
         let className = SHOW_CLASSES[type];
268
 
268
 
269
         if(element.classList.contains(className)) {
269
         if(element.classList.contains(className)) {
277
      * Returns default display style for the tag
277
      * Returns default display style for the tag
278
      * @param tag
278
      * @param tag
279
      * @returns {*}
279
      * @returns {*}
280
+     * @private
280
      */
281
      */
281
-    getElementDefaultDisplay(tag) {
282
+    _getElementDefaultDisplay(tag) {
282
         let tempElement = document.createElement(tag);
283
         let tempElement = document.createElement(tag);
283
 
284
 
284
         document.body.appendChild(tempElement);
285
         document.body.appendChild(tempElement);

Loading…
Cancel
Save