-
Notifications
You must be signed in to change notification settings - Fork 0
/
manual-trigger.js
61 lines (50 loc) · 1.47 KB
/
manual-trigger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
--------------------------------
Infinite Scroll Behavior
Manual / Twitter-style
--------------------------------
+ https://github.com/paulirish/infinitescroll/
+ version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function($, undefined) {
$.extend($.infinitescroll.prototype,{
_setup_twitter: function infscr_setup_twitter () {
var opts = this.options,
instance = this;
// Bind nextSelector link to retrieve
$(opts.nextSelector).click(function(e) {
if (e.which == 1 && !e.metaKey && !e.shiftKey) {
e.preventDefault();
instance.retrieve();
}
});
// Define loadingStart to never hide pager
instance.options.loading.start = function (opts) {
opts.loading.msg
.appendTo(opts.loading.selector)
.show(opts.loading.speed, function () {
instance.beginAjax(opts);
});
}
},
_showdonemsg_twitter: function infscr_showdonemsg_twitter () {
var opts = this.options,
instance = this;
//Do all the usual stuff
opts.loading.msg
.find('img')
.hide()
.parent()
.find('div').html(opts.loading.finishedMsg).animate({ opacity: 1 }, 2000, function () {
$(this).parent().fadeOut('normal');
});
//And also hide the navSelector
$(opts.navSelector).fadeOut('normal');
// user provided callback when done
opts.errorCallback.call($(opts.contentSelector)[0],'done');
}
});
})(jQuery);