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

Use "ancestor" instead of "parent" #20

Merged
merged 4 commits into from
Aug 17, 2015
Merged

Use "ancestor" instead of "parent" #20

merged 4 commits into from
Aug 17, 2015

Conversation

lencioni
Copy link
Collaborator

The term "parent" means that the node is the direct ancestor of the
descendant component (child). This is not necessarily the case in this
code, so I am changing the terminology to use the more general and
accurate "ancestor".

I also made some minor changes that ESLint pointed out.

lencioni added 4 commits July 18, 2015 12:12
The term "parent" means that the node is the direct ancestor of the
descendant component (child). This is not necessarily the case in this
code, so I am changing the terminology to use the more general and
accurate "ancestor".
ESLint pointed out a number of small improvements, all of which I make
in this commit. These changes slightly improve the readability of the
code.
This ES6 syntax is slightly nicer than the old way of doing this, and
more consistent with the Brigade codebase.
Our tests were failing in Travis CI with the following error:

> Definition for rule 'computed-property-spacing' was not found.

I think that bumping the ESLint version will resolve this, and I figured
I'd just bump everything up to the latest stable versions.
//
// Cannot read property 'removeEventListener' of undefined
this.scrollableParent.removeEventListener('scroll', this._handleScroll);
this.scrollableAncestor.removeEventListener('scroll', this._handleScroll);
window.removeEventListener('resize', this._handleScroll);

Choose a reason for hiding this comment

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

Shouldn't the removal of the resize listener from the window always occur, regardless of whether or not the scrollableAncestor is mounted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah yes, I think so. Good call.

lencioni added a commit that referenced this pull request Aug 17, 2015
Use "ancestor" instead of "parent"
@lencioni lencioni merged commit b1356a2 into master Aug 17, 2015
@lencioni lencioni deleted the ancestor branch August 17, 2015 15:57
lencioni added a commit that referenced this pull request Aug 17, 2015
As eagle-eyed @jeffkole pointed out [0], we always want to remove this
event listener, even if the scrollableAncestor does not exist.

[0]: #20 (comment)
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.

2 participants