-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix clean js from styles 1 #1111
Conversation
8e8ae88
to
64bf25b
Compare
64bf25b
to
1b1b947
Compare
|
||
console.log('recording is visible', isVisible); | ||
|
||
if (isVisible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable above should probably be renamed because if (isVisible) showElement(); doesn't make sense. The console log above also prints the wrong message. The recording is not visible at this point, it will be made visible after we call showElement. Let's call the variable isShow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to shouldShow
} | ||
|
||
document.querySelector('#recordingSpinner').classList | ||
.toggle('show-inline', recordingState === Status.RETRYING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see this line doesn't refactor existing code. Is it a fix for a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably these lines were added after rebase (because refactored version is above)
} else { | ||
$("#subject").css({display: "none"}); | ||
toggleFunction = UIUtil.hideElement.bind(UIUtil); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be shortened by let toggleFunction = (subject) ? xxxx : yyyy; syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* @param tag | ||
* @returns {*} | ||
*/ | ||
getElementDefaultDisplay(tag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a private method only let's rename it to _getElement......
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we can expose this method to the interface of UIUtils
(it can be useful to define if element is block or inline) but we don't use it in the code outside the module. So, let's keep it private for now.
Do not change element styles directly, use css classes instead. It helps to: