scrollinity 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/scrollinity/version.rb +1 -1
- data/vendor/assets/javascripts/scrollinity.js +34 -27
- metadata +12 -18
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9d71c2fe6eb177bf9021286a2c2c01b8ddf0dece
|
4
|
+
data.tar.gz: 9f7df0f69923c032b1b0772618797dbe8f3d2114
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 194e9cf73c48ff0ff86ed0d53a155661b2f4de84304e16cb25b6412f2760472d3229edddd6170906c7e71a0b90daadc29f987c641fa8a677fb7c40cb91e494de
|
7
|
+
data.tar.gz: 56b50f832b900ccd08d8d4d8f199e7a82ae1bcf5ea6e21b992845b55a2ed7d84e57eec39620202e55ca6a88119bc88f222dfd17c00b5e6aaf4d3a5a3b1ce268c
|
data/lib/scrollinity/version.rb
CHANGED
@@ -1,12 +1,36 @@
|
|
1
1
|
$(document).ready(function(){
|
2
|
+
|
3
|
+
'use strict';
|
4
|
+
|
5
|
+
function load_new_items(){
|
6
|
+
var sign = load_path.indexOf('?') >= 0 ? '&' : '?'
|
7
|
+
$.get(load_path + sign + 'page=' + (++page_num), function(data, e) {
|
8
|
+
if(data.length < 5) {
|
9
|
+
var page_num = 0;
|
10
|
+
return false;
|
11
|
+
}
|
12
|
+
data_container.append(data);
|
13
|
+
}).complete(function() {
|
14
|
+
loading_pic.hide();
|
15
|
+
});
|
16
|
+
}
|
17
|
+
|
18
|
+
function loading_hidden(){
|
19
|
+
return !loading_pic.is(':visible');
|
20
|
+
}
|
21
|
+
|
22
|
+
function near_bottom(){
|
23
|
+
return $(window).scrollTop() > $(document).height() - $(window).height() - bottom_px_limit;
|
24
|
+
}
|
25
|
+
|
2
26
|
if($('*[data-scrollinity-path]').length > 0) {
|
3
|
-
var page_num
|
4
|
-
load_path
|
5
|
-
loading_pic
|
6
|
-
data_container
|
7
|
-
bottom_px_limit = $('*[data-scrollinity-bottom-px-limit]').data('scrollinity-bottom-px-limit');
|
27
|
+
var page_num = 1
|
28
|
+
var load_path = $('*[data-scrollinity-path]').data('scrollinity-path');
|
29
|
+
var loading_pic = $('*[data-scrollinity-loading-pic]');
|
30
|
+
var data_container = $('#' + $('*[data-scrollinity-data-container]').data('scrollinity-data-container'));
|
31
|
+
var bottom_px_limit = $('*[data-scrollinity-bottom-px-limit]').data('scrollinity-bottom-px-limit');
|
8
32
|
|
9
|
-
$(window).on('scroll', function(){
|
33
|
+
$(window).on('scroll.scrollinity', function(){
|
10
34
|
if(loading_hidden() && near_bottom()) {
|
11
35
|
if(page_num > 0) {
|
12
36
|
loading_pic.show();
|
@@ -14,26 +38,9 @@ $(document).ready(function(){
|
|
14
38
|
}
|
15
39
|
}
|
16
40
|
});
|
17
|
-
|
18
|
-
function load_new_items(){
|
19
|
-
sign = load_path.indexOf('?') >= 0 ? '&' : '?'
|
20
|
-
$.get(load_path + sign + 'page=' + (++page_num), function(data, e) {
|
21
|
-
if(data.length < 5) {
|
22
|
-
page_num = 0;
|
23
|
-
return false;
|
24
|
-
}
|
25
|
-
data_container.append(data);
|
26
|
-
}).complete(function() {
|
27
|
-
loading_pic.hide();
|
28
|
-
});
|
29
|
-
}
|
30
|
-
|
31
|
-
function loading_hidden(){
|
32
|
-
return !loading_pic.is(':visible');
|
33
|
-
}
|
34
|
-
|
35
|
-
function near_bottom(){
|
36
|
-
return $(window).scrollTop() > $(document).height() - $(window).height() - bottom_px_limit;
|
37
|
-
}
|
38
41
|
}
|
42
|
+
else {
|
43
|
+
$(window).off('scroll.scrollinity');
|
44
|
+
}
|
45
|
+
|
39
46
|
});
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrollinity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- HeeL
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-02-21 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.3'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.3'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: Add effect of infinite scroll on the page. Good replacement for traditional
|
@@ -51,7 +46,7 @@ executables: []
|
|
51
46
|
extensions: []
|
52
47
|
extra_rdoc_files: []
|
53
48
|
files:
|
54
|
-
- .gitignore
|
49
|
+
- ".gitignore"
|
55
50
|
- Gemfile
|
56
51
|
- LICENSE.txt
|
57
52
|
- README.md
|
@@ -63,26 +58,25 @@ files:
|
|
63
58
|
homepage: https://github.com/HeeL/scrollinity
|
64
59
|
licenses:
|
65
60
|
- MIT
|
61
|
+
metadata: {}
|
66
62
|
post_install_message:
|
67
63
|
rdoc_options: []
|
68
64
|
require_paths:
|
69
65
|
- lib
|
70
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
67
|
requirements:
|
73
|
-
- -
|
68
|
+
- - ">="
|
74
69
|
- !ruby/object:Gem::Version
|
75
70
|
version: '0'
|
76
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
72
|
requirements:
|
79
|
-
- -
|
73
|
+
- - ">="
|
80
74
|
- !ruby/object:Gem::Version
|
81
75
|
version: '0'
|
82
76
|
requirements: []
|
83
77
|
rubyforge_project:
|
84
|
-
rubygems_version:
|
78
|
+
rubygems_version: 2.4.5.1
|
85
79
|
signing_key:
|
86
|
-
specification_version:
|
80
|
+
specification_version: 4
|
87
81
|
summary: Add effect of infinite scroll on the page
|
88
82
|
test_files: []
|