mercredi 15 avril 2015

Get parentView from within Ember JS liquid-fire v0.19.3 custom transition

I want to get reference to the parentView of this.oldElement or this.newElement from within my custom transition. Previously, I would simply be able to callthis.parentView but I believe this private API has been phased out.


Something like this:



/* app/transitions/my-cool-transition.js */
export default function(foo, bar, _opts) {
var parentView = this.parentView; //FIX: This doesn't work anymore

if(parentView) {
// Do stuff...
}

stop(this.oldElement);
return Ember.RSVP.Promise.all([
animate(...),
animate(...)
]).then(function() {
// Finished, now manipulate the parent view again
if (parentView) {
// Do stuff...
}
});
});

Aucun commentaire:

Enregistrer un commentaire