Trouble with contextual links after node teaser refresh via ajax
Once new HTML has been added to the DOM in a custom way, then to attach all Drupal behaviors defined by active modules, you need to call Drupal.attachBehaviors().

It may be possible that you are not calling Drupal.attachBehaviors() after new content is injected into the DOM. Until you do this, NO Javascript will be applied to the newly inserted elements.

Example of attaching behavior ('YOUR_DOM_SELECTOR' will the element which you are refreshing via ajax):

Drupal.attachBehaviors('YOUR_DOM_SELECTOR');