-
Notifications
You must be signed in to change notification settings - Fork 11
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
Refactor initializer container lookups into an instanceIntializer #15
Conversation
|
||
//TextField/TextArea are currently uninjectable, so we're going to hack our | ||
//way in | ||
Ember.TextSupport.reopen({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be on an InstanceInitializer, it should only be run once, not per instance.,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, good point. Overzealous copypasta FTL
// Set up a handler on the document for keyboard events that are not | ||
// handled by Ember's event dispatcher. | ||
Ember.$(document).on('keyup.outside_ember_event_delegation', null, | ||
function(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also likely don't want to add multiple of these, do we tear them down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe they're ever torn down. What's the best practice for an instance UNinitializer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't an instance initializer though, it should only occur once. That being said, it likely just be something the application view does, as that has the right life-cycle and scope.
Unfortunately, each approach appears pretty lame.
But for reference, the eventdispatcher (which this ultimately augments) is created at app boot, and removed at app teardown.
I am correct that this breaks compatibility with Ember 1.10? That may be fine, I just want to verify so we can message accordingly. |
I think we don't have to lose 1.10 compatibility if we're clever. My suggestion for moving forward is the following:
I have built a thorough regex to extract the necessary version info from Thoughts @stefanpenner @lukemelia ? IMO the alternative is branching for pre/post |
@truenorth I'm +1 on your approach. |
ping |
Refactor initializer container lookups into an instanceIntializer
Thanks @truenorth! |
This addresses an ember-1.11 deprecation warning
http://emberjs.com/deprecations/v1.x/#toc_access-to-instances-in-initializers