From 148960c6d2202d07d944057bcba39087d2897104 Mon Sep 17 00:00:00 2001 From: Ilya Daynatovich Date: Fri, 11 Nov 2016 12:27:29 +0200 Subject: [PATCH] made editions --- modules/UI/recording/Recording.js | 9 ++------- modules/UI/side_pannels/chat/Chat.js | 6 +++--- modules/UI/util/UIUtil.js | 7 ++++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/modules/UI/recording/Recording.js b/modules/UI/recording/Recording.js index 9f203a336..3ebc37574 100644 --- a/modules/UI/recording/Recording.js +++ b/modules/UI/recording/Recording.js @@ -387,12 +387,10 @@ var Recording = { * @param show {true} to show the recording button, {false} to hide it */ showRecordingButton (show) { - let isVisible = show && _isRecordingButtonEnabled(); + let shouldShow = show && _isRecordingButtonEnabled(); let id = 'toolbar_button_record'; - console.log('recording is visible', isVisible); - - if (isVisible) { + if (shouldShow) { UIUtil.showElement(id); } else { UIUtil.hideElement(id); @@ -485,9 +483,6 @@ var Recording = { } else { UIUtil.hideElement(spinnerId); } - - document.querySelector('#recordingSpinner').classList - .toggle('show-inline', recordingState === Status.RETRYING); }, // checks whether recording is enabled and whether we have params // to start automatically recording diff --git a/modules/UI/side_pannels/chat/Chat.js b/modules/UI/side_pannels/chat/Chat.js index 195b415a5..10cb3557e 100644 --- a/modules/UI/side_pannels/chat/Chat.js +++ b/modules/UI/side_pannels/chat/Chat.js @@ -296,11 +296,11 @@ var Chat = { let toggleFunction; if (subject) { subject = subject.trim(); - toggleFunction = UIUtil.showElement.bind(UIUtil); - } else { - toggleFunction = UIUtil.hideElement.bind(UIUtil); } + toggleFunction = subject ? UIUtil.showElement : UIUtil.hideElement; + toggleFunction = toggleFunction.bind(UIUtil); + let subjectId = 'subject'; let html = linkify(UIUtil.escapeHtml(subject)); $(`#${subjectId}`).html(html); diff --git a/modules/UI/util/UIUtil.js b/modules/UI/util/UIUtil.js index db2fb76a3..64dacaa0c 100644 --- a/modules/UI/util/UIUtil.js +++ b/modules/UI/util/UIUtil.js @@ -241,7 +241,7 @@ const SHOW_CLASSES = { element.classList.remove('hide'); } - let type = this.getElementDefaultDisplay(element.tagName); + let type = this._getElementDefaultDisplay(element.tagName); let className = SHOW_CLASSES[type]; element.classList.add(className); }, @@ -263,7 +263,7 @@ const SHOW_CLASSES = { return; } - let type = this.getElementDefaultDisplay(element.tagName); + let type = this._getElementDefaultDisplay(element.tagName); let className = SHOW_CLASSES[type]; if(element.classList.contains(className)) { @@ -277,8 +277,9 @@ const SHOW_CLASSES = { * Returns default display style for the tag * @param tag * @returns {*} + * @private */ - getElementDefaultDisplay(tag) { + _getElementDefaultDisplay(tag) { let tempElement = document.createElement(tag); document.body.appendChild(tempElement);