Skip to content
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

support custom events to trigger update #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

barunio
Copy link

@barunio barunio commented Apr 21, 2014

This PR provides a way to use peek-performance_bar with standard Ajax requests that are not carried out via Pjax or Turbolinks, simply by supporting custom peek:start and peek:end events.

For example, you could do something like this to update the performance bar for all Ajax requests:

$(document).on('ajax:send', function() { $(this).trigger('peek:start') })
$(document).on('ajax:complete', function() { $(this).trigger('peek:end') })

@dewski
Copy link
Member

dewski commented May 5, 2014

🆒 could you update the documentation showing how to use this?

@barunio
Copy link
Author

barunio commented May 10, 2014

@dewski I've updated the README. Let me know if it looks good to you.

@barunio
Copy link
Author

barunio commented Jun 5, 2014

@dewski ping. Any reason not to merge this in?

@dewski
Copy link
Member

dewski commented Jun 6, 2014

@barunio sorry for the delayed response. There seems to be a merge conflict and I can't merge it until that is resolved. The docs look good to me!

Another small note after reviewing the code again is it would be helpful to change the event prefixes from peek: to peek:performance-bar that way it's only scoped for this view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants