spaghetti 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ module SpaghettiHelpers
|
|
3
3
|
output = ''.html_safe
|
4
4
|
puts path_or_items.class.name
|
5
5
|
if path_or_items.class.name == 'String'
|
6
|
-
output << "<div class=\"#{ name } spaghetti\" data-spaghetti-enabled=\"1\" data-spaghetti-url=\"#{ path_or_items }\" data-spaghetti-next-page=\"1\"><div class=\"items\"></div><div class=\"throbber\">#{ image_tag 'throbber.gif' }</div></div>".html_safe
|
6
|
+
output << "<div class=\"#{ name } spaghetti spaghetti-empty\" data-spaghetti-enabled=\"1\" data-spaghetti-url=\"#{ path_or_items }\" data-spaghetti-next-page=\"1\"><div class=\"items\"></div><div class=\"throbber\">#{ image_tag 'throbber.gif' }</div></div>".html_safe
|
7
7
|
else
|
8
8
|
if path_or_items.any?
|
9
9
|
output << "$('.#{ name } .items').append('#{ j render path_or_items }');".html_safe
|
data/lib/spaghetti/version.rb
CHANGED
@@ -1,4 +1,15 @@
|
|
1
1
|
$(function() {
|
2
|
+
$('.spaghetti-empty').each(function() {
|
3
|
+
$.ajax({
|
4
|
+
url: $(this).data('spaghetti-url') + '?page=' + $(this).data('spaghetti-next-page'),
|
5
|
+
type: 'get',
|
6
|
+
dataType: 'script',
|
7
|
+
success: function() {
|
8
|
+
$(window).sausage('draw');
|
9
|
+
$(this).removeClass('spaghetti-empty');
|
10
|
+
}
|
11
|
+
});
|
12
|
+
});
|
2
13
|
function nearBottomOfPage() {
|
3
14
|
return $(window).scrollTop() > $(document).height() - $(window).height() - 200;
|
4
15
|
}
|
@@ -20,4 +31,4 @@ $(function() {
|
|
20
31
|
}
|
21
32
|
});
|
22
33
|
$(window).sausage();
|
23
|
-
});
|
34
|
+
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spaghetti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
63
|
version: '0'
|
64
64
|
segments:
|
65
65
|
- 0
|
66
|
-
hash:
|
66
|
+
hash: 4575430611413531662
|
67
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
68
|
none: false
|
69
69
|
requirements:
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
version: '0'
|
73
73
|
segments:
|
74
74
|
- 0
|
75
|
-
hash:
|
75
|
+
hash: 4575430611413531662
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
78
|
rubygems_version: 1.8.24
|