This repository has been archived by the owner on Aug 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
67 lines (49 loc) · 1.5 KB
/
index.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
62
63
64
65
66
67
"use strict";
if (Meteor.isClient) {
if(Meteor.isCordova) {
console.log("Yes, I am a cordova app!");
}
Meteor.startup(function() {
console.log('Meteor.startup was called!');
$('#scroller').on('iscrollpulled', function(ev, d) {
console.log('making mock asynchronous call');
window.setTimeout(function() {
var $sc = $('#scroller');
$sc
.children(':eq(1)')
.children(':eq(0)')
.before('<p class="bubbledRight">New item added from refresh!</p>');
$sc.iscroll('refresh');
d.deferred.resolve();
}, 5500);
});
$('#scroller').on('create', function() {
});
$('#scroller').on('iscrollcreated', function(){
});
$('#scroller').on('iscrollstart', function(ev, d){
});
$('#scroller').on('iscrollscroll', function(ev, d){
});
$('#scroller').on('iscrollend', function(ev, d){
});
$('#scroller').on('click', function(){
console.log('click -> ', arguments);
});
var count = 3;
$('#scroller').on('iscrollinfinite', function(ev, d) {
if(count<0) return;
window.setTimeout(function() {
count-=1;
$('#scroller div:eq(1)')
.append('<p class="bubbled' + (count % 2 === 0 ? 'Left' : 'Right') + '">This item was created at:<br/> ' + Date().toString() + '</p>');
d.deferred.resolve();
}, 5500);
});
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}