ajaxspin 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +5 -0
- data/lib/assets/javascripts/ajaxspin.js.coffee +10 -7
- metadata +3 -9
data/README.md
CHANGED
@@ -67,3 +67,8 @@ That's all.
|
|
67
67
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
68
68
|
4. Push to the branch (`git push origin my-new-feature`)
|
69
69
|
5. Create new Pull Request
|
70
|
+
|
71
|
+
## Links
|
72
|
+
|
73
|
+
- [Building a simple and non intrusive AJAX status with CoffeeScript in RubyOnRails](http://caarlos0.github.com/posts/building-a-simple-and-non-intrusive-ajax-status-with-coffeescript-in-rubyonrails/)
|
74
|
+
- [Rails AJAXSpin](http://caarlos0.github.com/posts/rails-ajaxspin/)
|
@@ -2,22 +2,25 @@ $ = jQuery
|
|
2
2
|
|
3
3
|
$.fn.ajaxSpin = (opts) ->
|
4
4
|
opts = $.extend {}, $.fn.ajaxSpin.options, opts
|
5
|
+
console.log opts
|
5
6
|
count = 0
|
6
7
|
|
7
|
-
loadState = (element
|
8
|
+
loadState = (element) ->
|
8
9
|
count++
|
9
10
|
element.spin opts.spinjsOpts
|
10
11
|
|
11
|
-
doneState = (element
|
12
|
+
doneState = (element) ->
|
12
13
|
count--
|
13
|
-
|
14
|
+
if count <= 0
|
15
|
+
element.spin false
|
16
|
+
count = 0
|
14
17
|
|
15
18
|
@each ->
|
16
19
|
$e = $(this)
|
17
|
-
$(document).on opts.showEvents,
|
18
|
-
loadState $e
|
19
|
-
$(document).on opts.hideEvents,
|
20
|
-
doneState $e
|
20
|
+
$(document).on opts.showEvents, ->
|
21
|
+
loadState $e
|
22
|
+
$(document).on opts.hideEvents, ->
|
23
|
+
doneState $e
|
21
24
|
|
22
25
|
$.fn.ajaxSpin.options =
|
23
26
|
spinjsOpts: undefined
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ajaxspin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: coffee-rails
|
@@ -65,21 +65,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- - ! '>='
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
|
-
segments:
|
69
|
-
- 0
|
70
|
-
hash: -2328945257175645884
|
71
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
69
|
none: false
|
73
70
|
requirements:
|
74
71
|
- - ! '>='
|
75
72
|
- !ruby/object:Gem::Version
|
76
73
|
version: '0'
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
hash: -2328945257175645884
|
80
74
|
requirements: []
|
81
75
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.8.
|
76
|
+
rubygems_version: 1.8.23
|
83
77
|
signing_key:
|
84
78
|
specification_version: 3
|
85
79
|
summary: A simple asset gem that provide an out-of-the box ajax status spin indicator
|