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

Fix clicking when there is no active cursor. #93

Merged
merged 1 commit into from
Aug 26, 2015

Conversation

mixonic
Copy link
Contributor

@mixonic mixonic commented Aug 26, 2015

Also refactors the offsets return value into a Range object consisting of two Position objects. These encapsulate the difficulties of creating a meaningful position data-set for a given DOM node.

Also refactors the `offsets` return value into a `Range` object
consisting of two `Position` objects. These encapsulate the difficulties
of creating a meaningful position data-set for a given DOM node.
@mixonic
Copy link
Contributor Author

mixonic commented Aug 26, 2015

Also moved cursor into utils. I'd like to get to a point where the models directory is all abstract post stuff.


if (!range) {
if (selection.rangeCount === 0 || !selection.getRangeAt(0)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think selection.rangeCount === 0 is sufficient. I'm not sure what circumstance would result in the rangeCount being non-zero and getRangeAt(0) returning undefined

@bantic
Copy link
Collaborator

bantic commented Aug 26, 2015

👍

bantic added a commit that referenced this pull request Aug 26, 2015
Fix clicking when there is no active cursor.
@bantic bantic merged commit 3495f71 into bustle:master Aug 26, 2015
@bantic bantic deleted the click-card branch August 26, 2015 20:44
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