last day (15 days later) » 

7:17 PM
1
A: Calling a jquery event after the page transitions

Steve H.Here's an example that uses jQuery to show/hide an alert as different transitions occur. Click on "Run code snippet" to see the example. Click on the A, B, and C links to transition to those routes and see the jquery animation. var App = Ember.Application.create(); App.Router.map(functi...

 
Thanks Steve! When using did and willTransition, i was able to make 2 console logs appear before and after the route was loaded. However the alerts do not appear. Similarly when i try to add a class to a dom element using $().addClass(), no class is added
 
Those sound like problems not related to your question. I'd suggest editing your question and adding more code to get more help.
 
how does trying to make a jquery event activate post transition different than my question 'Calling a jquery event after the page transitions'?
 
My assumption was that your problem was about the proper hook for executing code related to Ember transitions. The problems you describe in your comment (and not your question) are about the use of jQuery more than when the code runs. You didn't mention that in your question, nor did you post the code, assuming you changed it to use the willTransition / didTransition technique.
 
Actually it is in my question because it's the title. Second, the problems i describe in my comment are related to the didTransition function not responding to my jquery (which again, is mentioned in the title). It could be plain js or anything the manipulates the dom, that's not the point. The point is that the didTransition function is not calling jquery or even your alerts after the transition.
 
7:17 PM
Without more code, I'm unable to help you any further. Please see: stackoverflow.com/help/mcve
 
hello
didTransition: function() {
  Ember.$('.alert').fadeIn(200);
  console.log('pew');
  $('.float-right-col').addClass('float-right-col-minimized').delay(200);
},
for instance, pew is called but everything else isnt
perhaps it is because $('.float-right-col').addClass('float-right-col-minimized').delay(200); is being called before the dom loads
 
hi
so you see "pew" in the console?
how about "console.log($('.float-right-col'))" ?
I'm assuming that the first line is working? the fadeIn?
DOM manipulation is Ember's responsibility, so you don't have to be concerned with that in an Ember hook
My guess is that Ember.$('.alert') is not finding the object in your template.
Sorry, I have to run to the pharmacy. I'm happy to help you if you want to add information to this chat. I'll check it later.
 

last day (15 days later) »