Permalink
Browse files

fix simulating click on the more button

  • Loading branch information...
1 parent 7f4f05b commit dd9b8ed384e834334c959d33c6252f411215d428 @mislav committed Oct 30, 2009
Showing with 5 additions and 3 deletions.
  1. +5 −3 endless_tweets/endless_tweets.js
View
8 endless_tweets/endless_tweets.js
@@ -111,7 +111,7 @@ if ($et.timeline) {
// simulate a click to the "more" link when approaching bottom
window.addEventListener('scroll', function(e) {
if (enablePreloading && !loading && nearingBottom()) {
- var moreButton = jQuery('#pagination a[rel=next]')
+ var moreButton = jQuery('#pagination #more')
if (moreButton.length) {
var matches = moreButton.attr('href').match(/\bpage=(\d+)/)
loading = matches[0]
@@ -120,8 +120,10 @@ if ($et.timeline) {
// simulate click by manually invoking cached event handlers
// (jQuery's trigger functionality doesn't work in Greasemonkey sandbox)
- var handlers = moreButton.data('events')['click']
- for (guid in handlers) handlers[guid].call(moreButton.get(0))
+ var handlers = jQuery(realWindow.document).data('events').live
+ for (var key in handlers)
+ if (key.indexOf(moreButton.selector + 'click') >= 0)
+ handlers[key].call(moreButton.get(0))
}
}
}, false)

0 comments on commit dd9b8ed

Please sign in to comment.