Skip to content
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

Chore: Group CSS constants in a more readable manner #150

Merged
merged 11 commits into from
Mar 30, 2018

Conversation

pramodsum
Copy link
Contributor

No description provided.

@boxcla
Copy link

boxcla commented Mar 28, 2018

Verified that @pramodsum has signed the CLA. Thanks for the pull request!

@pramodsum pramodsum changed the title Chore: Cleanup + group CSS constants in a more readable manner Chore: Group CSS constants in a more readable manner Mar 28, 2018
@@ -12,6 +12,8 @@ import {
SELECTOR_ANNOTATION_DIALOG
} from '../../constants';

const SELECTOR_ANNOTATED_ELEMENT = '.annotated-element';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you roll .annotated-element into constants. It's been copy-pasted in quite a few places

@@ -61,8 +43,10 @@ export function isPresentation(annotatedElement) {
* @return {boolean} Whether or not a dialog is active
*/
export function hasActiveDialog(annotatedEl) {
const commentsDialogEl = annotatedEl.querySelector(`.${CLASS_ANNOTATION_DIALOG}:not(.bp-is-hidden)`);
const highlightDialogEl = annotatedEl.querySelector(`.${CLASS_ANNOTATION_HIGHLIGHT_DIALOG}:not(.bp-is-hidden)`);
const commentsDialogEl = annotatedEl.querySelector(`.${constants.CLASS_ANNOTATION_DIALOG}:not(.bp-is-hidden)`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put bp-is-hidden into constants?

Copy link
Contributor

@jeremypress jeremypress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you import * and name the import vs. import specific classes? {CLASS_FOO} from '/constants'

@pramodsum
Copy link
Contributor Author

Initially I think we did that for classes where we're not really using many constants. I do plan on going through and just doing import * later

@pramodsum pramodsum merged commit b110632 into box:master Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants