activeadmin-async_panel 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35c8a26c0a51d58a1cad63b3ad9cbb2a44a5cf1121fc499e6ab7ef51da3e845d
4
- data.tar.gz: c14590b597fd077cc020922ff44dfb3ee03865567267dc3e28b7471442ca911a
3
+ metadata.gz: 1de7dc1392bab5f26eeeb20bc8ad71f5be255b52d4bb9f7df693b21c90d8b8bc
4
+ data.tar.gz: da2fc1afcfe72ac62136f80a8d4e177af353f69eb78163e80b476ea0c96bf76c
5
5
  SHA512:
6
- metadata.gz: dd925810ab869a08af5f26c2e0a102fc8a835ae20c19bb52257cb3f61d3d81764a5a0d97f3e013b46aba0caee6085e6c0a6bf5865285d27c8e87763502001b0d
7
- data.tar.gz: dfe7fff7bf647ebc0b5e4d6c1e578cabe5a81afb7966018b41e882cdc7b96bbc24514c431ce055930384ba61805e21af98bd901f228daefca5697bf42df9854d
6
+ metadata.gz: fcce241dec8e39f2c99c84757dacf4c44fc51a93d97b49ce4dc3b369fbabea55df653d3675571aaffb80a917c08fdfcbb2fc805667385d2d908905b844d03c1b
7
+ data.tar.gz: 3b2b5447fbb9a758d5ab3b6e7510e4e507dea92befb43c88aff4d348262c8f713b763b1dbe2dbbae2724835e9e165a53e8f6386ed87d3bad68c5a133606fdd82
@@ -1 +1 @@
1
- 2.6.1
1
+ 2.6.5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activeadmin-async_panel (0.2.3)
4
+ activeadmin-async_panel (0.2.4)
5
5
  activeadmin (>= 1.0)
6
6
  coffee-rails (>= 4.1)
7
7
 
@@ -27,7 +27,7 @@ GEM
27
27
  erubis (~> 2.7.0)
28
28
  rails-dom-testing (~> 1.0, >= 1.0.5)
29
29
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
30
- activeadmin (1.3.1)
30
+ activeadmin (1.4.3)
31
31
  arbre (>= 1.1.1)
32
32
  coffee-rails
33
33
  formtastic (~> 3.1)
@@ -55,7 +55,7 @@ GEM
55
55
  thread_safe (~> 0.3, >= 0.3.4)
56
56
  tzinfo (~> 1.1)
57
57
  addressable (2.4.0)
58
- arbre (1.1.1)
58
+ arbre (1.2.1)
59
59
  activesupport (>= 3.0.0)
60
60
  arel (6.0.4)
61
61
  builder (3.2.3)
@@ -77,7 +77,7 @@ GEM
77
77
  execjs
78
78
  coffee-script-source (1.12.2)
79
79
  concurrent-ruby (1.1.4)
80
- crass (1.0.4)
80
+ crass (1.0.5)
81
81
  database_cleaner (1.5.3)
82
82
  diff-lcs (1.2.5)
83
83
  docile (1.1.5)
@@ -88,7 +88,7 @@ GEM
88
88
  factory_girl_rails (4.5.0)
89
89
  factory_girl (~> 4.5.0)
90
90
  railties (>= 3.0.0)
91
- ffi (1.9.25)
91
+ ffi (1.11.2)
92
92
  formtastic (3.1.5)
93
93
  actionpack (>= 3.2.13)
94
94
  formtastic_i18n (0.6.0)
@@ -104,7 +104,7 @@ GEM
104
104
  has_scope (~> 0.6)
105
105
  railties (>= 4.2, < 5.3)
106
106
  responders
107
- jquery-rails (4.3.3)
107
+ jquery-rails (4.3.5)
108
108
  rails-dom-testing (>= 1, < 3)
109
109
  railties (>= 4.2.0)
110
110
  thor (>= 0.14, < 2.0)
@@ -125,7 +125,7 @@ GEM
125
125
  kaminari-core (1.1.1)
126
126
  launchy (2.4.3)
127
127
  addressable (~> 2.3)
128
- loofah (2.2.3)
128
+ loofah (2.3.1)
129
129
  crass (~> 1.0.2)
130
130
  nokogiri (>= 1.5.9)
131
131
  mail (2.7.1)
@@ -134,7 +134,7 @@ GEM
134
134
  mini_mime (1.0.1)
135
135
  mini_portile2 (2.4.0)
136
136
  minitest (5.11.3)
137
- nokogiri (1.10.1)
137
+ nokogiri (1.10.5)
138
138
  mini_portile2 (~> 2.4.0)
139
139
  phantomjs (2.1.1.0)
140
140
  poltergeist (1.10.0)
@@ -169,17 +169,17 @@ GEM
169
169
  rake (>= 0.8.7)
170
170
  thor (>= 0.18.1, < 2.0)
171
171
  rake (10.5.0)
172
- ransack (1.8.9)
173
- actionpack (>= 3.0, <= 5.1.1)
174
- activerecord (>= 3.0, <= 5.1.1)
175
- activesupport (>= 3.0, <= 5.1.1)
172
+ ransack (1.8.10)
173
+ actionpack (>= 3.0, < 5.2)
174
+ activerecord (>= 3.0, < 5.2)
175
+ activesupport (>= 3.0, < 5.2)
176
176
  i18n
177
177
  rb-fsevent (0.10.3)
178
- rb-inotify (0.9.10)
179
- ffi (>= 0.5.0, < 2)
180
- responders (2.4.0)
181
- actionpack (>= 4.2.0, < 5.3)
182
- railties (>= 4.2.0, < 5.3)
178
+ rb-inotify (0.10.0)
179
+ ffi (~> 1.0)
180
+ responders (2.4.1)
181
+ actionpack (>= 4.2.0, < 6.0)
182
+ railties (>= 4.2.0, < 6.0)
183
183
  rspec (3.3.0)
184
184
  rspec-core (~> 3.3.0)
185
185
  rspec-expectations (~> 3.3.0)
@@ -201,7 +201,7 @@ GEM
201
201
  rspec-mocks (~> 3.3.0)
202
202
  rspec-support (~> 3.3.0)
203
203
  rspec-support (3.3.0)
204
- sass (3.5.7)
204
+ sass (3.7.4)
205
205
  sass-listen (~> 4.0.0)
206
206
  sass-listen (4.0.0)
207
207
  rb-fsevent (~> 0.9, >= 0.9.4)
data/README.md CHANGED
@@ -53,6 +53,12 @@ panel 'Name', class: 'async-panel', 'data-url' => some_action_admin_resources_pa
53
53
 
54
54
  If you setup `data-period`, panel will be periodically updated. If not, it will be loaded once right after page load
55
55
 
56
+ If you set `data-clickable` to a truthy value, the panel will not be loaded upon initial page load. Instead, the panel will load upon clicking the panel header. Upon page load, the panel header will have a label of 'Click to Load'. Example:
57
+
58
+ ```ruby
59
+ panel 'Name', class: 'async-panel', 'data-url' => some_action_admin_resources_path, 'data-clickable' => 1
60
+ ```
61
+
56
62
  ### Step 2. Define action
57
63
 
58
64
  Define `member_action` or `collection_action` to handle request specified by path helper
@@ -19,6 +19,7 @@
19
19
  $ ->
20
20
  $('.async-panel').each (index, item) ->
21
21
  item = $(item)
22
+ requiresClick = !!item.data('clickable')
22
23
  worker = ->
23
24
  item.addClass('processing')
24
25
  $('h3', item).hide().show(0)
@@ -37,4 +38,12 @@ $ ->
37
38
  if period
38
39
  setTimeout worker, period * 1000
39
40
 
40
- worker()
41
+ registerHandler = ->
42
+ item.addClass('clickable')
43
+ $('h3', item).on 'click', ->
44
+ worker()
45
+
46
+ if requiresClick
47
+ registerHandler()
48
+ else
49
+ worker()
@@ -3,4 +3,24 @@
3
3
  background: url(<%= asset_path('loading-icon.gif') %>) 99% 50% no-repeat;
4
4
  background-size: 27px;
5
5
  }
6
- }
6
+ }
7
+ .async-panel.panel.clickable {
8
+ h3 {
9
+ &:hover {
10
+ cursor: pointer;
11
+ }
12
+
13
+ &::after {
14
+ float: right;
15
+ content: 'Click to Load';
16
+ padding: 0.25rem 0.5rem;
17
+ background-image: linear-gradient(180deg, #fff, #E7E7E7);
18
+ cursor: pointer;
19
+ border-top-left-radius: 1rem;
20
+ border-bottom-left-radius: 1rem;
21
+ height: 1rem;
22
+ margin-top: -0.25rem;
23
+ margin-right: -0.55rem;
24
+ }
25
+ }
26
+ }
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module AsyncPanel
3
- VERSION = '0.2.3'
3
+ VERSION = '0.2.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-async_panel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Emelyanov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-23 00:00:00.000000000 Z
11
+ date: 2019-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  - !ruby/object:Gem::Version
300
300
  version: '0'
301
301
  requirements: []
302
- rubygems_version: 3.0.1
302
+ rubygems_version: 3.0.3
303
303
  signing_key:
304
304
  specification_version: 4
305
305
  summary: AJAX-powered async panels for ActiveAdmin