peek-performance_bar icon indicating copy to clipboard operation
peek-performance_bar copied to clipboard

support custom events to trigger update

Open barunio opened this issue 10 years ago • 4 comments

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') })

barunio avatar Apr 21 '14 19:04 barunio

:cool: could you update the documentation showing how to use this?

dewski avatar May 05 '14 17:05 dewski

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

barunio avatar May 10 '14 19:05 barunio

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

barunio avatar Jun 05 '14 14:06 barunio

@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.

dewski avatar Jun 06 '14 06:06 dewski