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 EditorSelection.getCursor as it returns no elements #1648

Closed
wants to merge 1 commit into from
Closed

fix EditorSelection.getCursor as it returns no elements #1648

wants to merge 1 commit into from

Conversation

alaaibrahim
Copy link
Contributor

since yui-cursor was changed to be a class, so the selector should be changed

@JetFault
Copy link
Contributor

Fixes issue #1423

try {
range.selectNode(node);
} catch (err) {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@alaaibrahim,

Is there a reason why this try catch was added, or was it simply for pedantry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to ignore the INVALID_NODE_TYPE_ERR being thrown in IE10/11, where this error is silently ignored in FF.

@yahoocla
Copy link

CLA is valid!

@@ -902,7 +902,11 @@
node = Y.Node.getDOMNode(node);
var range = this.createRange();
if (range.selectNode) {
range.selectNode(node);
// Ignore selection errors like INVALID_NODE_TYPE_ERR
Copy link
Member

Choose a reason for hiding this comment

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

can you move this comment to the catch block? it makes more sense to have it there.

since yui-cursor was changed to be a class, so the call should be
changed.
@ezequiel
Copy link
Contributor

Merged into dev-master. Thanks.

@ezequiel ezequiel closed this Mar 27, 2014
@alaaibrahim alaaibrahim deleted the editorSelection branch August 17, 2014 07:54
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.

5 participants