How to get a jquery onClick to fire the same time as ember click and before mutation observers fire?

佐手、 提交于 2019-12-06 14:21:35

问题


I have a situation like so:

I have a button with an ember action that causes a route change, with corresponding DOM updates. This DOM is also being watched by a mutation observer. What I want to do is run some jquery code after the user clicks the button but before the mutation observers fire. However currently the mutation observer is always firing before the jquery onClick is fired.

How can I achieve my desired order? Should I use a deferred promise in the observer?

来源:https://stackoverflow.com/questions/29216434/how-to-get-a-jquery-onclick-to-fire-the-same-time-as-ember-click-and-before-muta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!