disable_with_spinner 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 91bea2d2a4bcaf9f9cfa34215aec513336b7ada3
4
+ data.tar.gz: aecbbe12ae8501985f2750bb3d081a72e633bf50
5
+ SHA512:
6
+ metadata.gz: e3527fa93ccf408f2a53935138b6284222d30a2cf8d468ea000130fbb7f93684418d2a933b40f333d21cd29d0e004445084c1fa2ea7e3ff39d9c615056e07fb9
7
+ data.tar.gz: 065dcd3673e796327c6d6b85ac88ec09cedfe528d5b9bbe3b89cd87f7f0d6e15f545385b104a25fc11e6390d6aa9f9f4e9411960cc55e7fea473d0edd7ae0e9a
Binary file
@@ -0,0 +1,11 @@
1
+ $ ->
2
+ $('[data-disable-with-spinner]').click ->
3
+ enableWith = $(this).html()
4
+ disabled = this
5
+ spinner = $('<div class="spinner-16px animated"></div>')
6
+ spinner.hide()
7
+ $(disabled).html(spinner)
8
+ spinner.fadeIn('fast')
9
+ $(disabled).on 'ajax:complete spinner:hide', ->
10
+ spinner.fadeOut 'fast', ->
11
+ $(disabled).html(enableWith)
@@ -0,0 +1,27 @@
1
+ .spinner-16px{
2
+ background: url(<%= image_path('spinner_16px.png') %>);
3
+ width: 16px;
4
+ height: 16px;
5
+ }
6
+ .spinner-16px.animated{
7
+ -webkit-animation: spinner-16px 0.6s steps(18) infinite;
8
+ animation: spinner-16px 0.6s steps(18) infinite;
9
+ }
10
+
11
+ @-webkit-keyframes spinner-16px{
12
+ from{
13
+ background-position: 0px
14
+ }
15
+ to{
16
+ background-position: -288px;
17
+ }
18
+ }
19
+
20
+ @keyframes spinner-16px{
21
+ from{
22
+ background-position: 0px
23
+ }
24
+ to{
25
+ background-position: -288px;
26
+ }
27
+ }
@@ -0,0 +1,6 @@
1
+ module DisableWithSpinner
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: disable_with_spinner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Anthon Mur
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Replace contents of a button with animated spinner with an ease
14
+ email: mibus32@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - app/assets/images/spinner_16px.png
20
+ - app/assets/javascripts/spinner.coffee
21
+ - app/assets/stylesheets/spinner.css.erb
22
+ - lib/disable_with_spinner.rb
23
+ homepage: http://rubygems.org/gems/disable_with_spinner
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.4.8
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Disable anything with spinner
47
+ test_files: []