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

assert that specified alignment target exists #65

Merged
merged 1 commit into from
Aug 3, 2015

Conversation

kagemusha
Copy link
Contributor

If alignmentTarget selector doesn't specify an existing element, almost certain to cause an error further down (e.g. call on undefined originOffset). This assert points out the source of the problem.

@@ -31,7 +31,9 @@ export default Ember.Component.extend({
updateAlignment: function() {
var alignmentTarget = this.get('alignmentTarget');
if (Ember.typeOf(alignmentTarget) === 'string') {
let alignmentTargetSelector = alignmentTarget;
alignmentTarget = Ember.$(alignmentTarget)[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use alignmentTargetSelector on the right hand side of this line to make this function more readable?

raycohen added a commit that referenced this pull request Aug 3, 2015
assert that specified alignment target exists
@raycohen raycohen merged commit c2c73d5 into yapplabs:master Aug 3, 2015
@lukemelia
Copy link
Contributor

Thanks @kagemusha!

@kagemusha
Copy link
Contributor Author

@lukemelia No prob. Thanks for the add-on!

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.

3 participants