render_async 2.1.1 β 2.1.2
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.
- checksums.yaml +4 -4
- data/.all-contributorsrc +9 -0
- data/CHANGELOG.md +4 -0
- data/README.md +17 -11
- data/app/views/render_async/_request_jquery.js.erb +1 -1
- data/app/views/render_async/_request_vanilla.js.erb +1 -1
- data/lib/render_async/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b91f800c218048a1e608c413909a1f9e55ae5a7ec450937d645f49526ac478c
|
4
|
+
data.tar.gz: a0675247df2c42dba16036c548e13f5443234724326e09ca2aa619cfa807f3bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e26aa8dda9a9e5cfb9b4617999bc7a6a80671bb11ee0cb3d7519f8ad3d03e6154370bf46f95c4cd9eefa3ae23b1643a99014d5501a2ea8008c8ad760b7e59801
|
7
|
+
data.tar.gz: c4f3aa9fe15e413df9ea442c8c7bd778aee560ef87a2af16973645eb3db2bedac4e2b3c944f06c737cf2371b07e35576a57823da4942db2687a04c064f33e4bb
|
data/.all-contributorsrc
CHANGED
@@ -159,6 +159,15 @@
|
|
159
159
|
"code",
|
160
160
|
"doc"
|
161
161
|
]
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"login": "preetsethi",
|
165
|
+
"name": "Preet Sethi",
|
166
|
+
"avatar_url": "https://avatars2.githubusercontent.com/u/8645918?v=4",
|
167
|
+
"profile": "https://www.linkedin.com/in/preetsethila/",
|
168
|
+
"contributions": [
|
169
|
+
"code"
|
170
|
+
]
|
162
171
|
}
|
163
172
|
],
|
164
173
|
"repoType": "github"
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 2.1.1 (2019/8/17)
|
2
|
+
* [#89](https://github.com/renderedtext/render_async/pull/89): Bump version to 2.1.2 - [@nikolalsvk](https://github.com/nikolalsvk).
|
3
|
+
* [#82](https://github.com/renderedtext/render_async/pull/88): When toggle true, do not fire `_renderAsyncFunc` on `turbolinks:load` - [@ThanhKhoaIT](https://github.com/ThanhKhoaIT).
|
4
|
+
|
1
5
|
### 2.1.1 (2019/8/17)
|
2
6
|
* [#85](https://github.com/renderedtext/render_async/pull/85): Rename main JS function and support toggle feature with other features - [@nikolalsvk](https://github.com/nikolalsvk).
|
3
7
|
* [#82](https://github.com/renderedtext/render_async/pull/82): Add toggle selector and event to render - [@ThanhKhoaIT](https://github.com/ThanhKhoaIT).
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[](https://semaphoreci.com/renderedtext/render_async)
|
2
|
-
[](#contributors)
|
3
3
|
[](https://badge.fury.io/rb/render_async)
|
4
4
|
[](https://codeclimate.com/github/renderedtext/render_async)
|
5
5
|
[](https://codeclimate.com/github/renderedtext/render_async/coverage)
|
@@ -255,29 +255,35 @@ to refresh the whole page just to retry them.
|
|
255
255
|
|
256
256
|
### Toggle event
|
257
257
|
|
258
|
-
|
259
|
-
|
260
|
-
|
258
|
+
You can trigger `render_async` loading by clicking or doing another event to a
|
259
|
+
certain HTML element. You can do this by passing in a selector and an event
|
260
|
+
name which will trigger `render_async`. If you don't specify an event name, the
|
261
|
+
default event that will trigger `render_async` will be 'click' event. You can
|
262
|
+
do this by doing the following:
|
261
263
|
|
262
264
|
```erb
|
263
|
-
<a href='#' id='detail-button'>
|
265
|
+
<a href='#' id='detail-button'>Detail</a>
|
264
266
|
<%= render_async comments_path, toggle: { selector: '#detail-button', event: :click } %>
|
265
267
|
```
|
266
268
|
|
267
|
-
This will trigger render_async to load the `comments_path` when you click the `#details-button` element.
|
269
|
+
This will trigger `render_async` to load the `comments_path` when you click the `#details-button` element.
|
268
270
|
|
269
|
-
You can also pass in a placeholder before the render_async is triggered
|
271
|
+
You can also pass in a placeholder before the `render_async` is triggered. That
|
272
|
+
way, the element that started `render_async` logic will be removed after the
|
273
|
+
request has been completed. You can achieve this behaviour with something like this:
|
270
274
|
|
271
275
|
```erb
|
272
276
|
<%= render_async comments_path, toggle: { selector: '#detail-button', event: :click } do %>
|
273
|
-
<a href='#' id='detail-button'>
|
277
|
+
<a href='#' id='detail-button'>Detail</a>
|
274
278
|
<% end %>
|
275
279
|
```
|
276
280
|
|
277
|
-
Also, you can mix interval and toggle features
|
281
|
+
Also, you can mix interval and toggle features. This way, you can turn polling
|
282
|
+
on, and off by clicking the "Detail" button. In order to do this, you need to
|
283
|
+
pass `toggle` and `interval` arguments to `render_async` call like this:
|
278
284
|
|
279
285
|
```erb
|
280
|
-
<a href='#' id='detail-button'>
|
286
|
+
<a href='#' id='detail-button'>Detail</a>
|
281
287
|
<%= render_async comments_path, toggle: { selector: '#detail-button', event: :click }, interval: 2000 %>
|
282
288
|
```
|
283
289
|
|
@@ -504,7 +510,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
504
510
|
| [<img src="https://avatars2.githubusercontent.com/u/3028124?v=4" width="100px;"/><br /><sub><b>Nikola Δuza</b></sub>](http://nikoladjuza.me/)<br />[π¬](#question-nikolalsvk "Answering Questions") [π»](https://github.com/renderedtext/render_async/commits?author=nikolalsvk "Code") [π](https://github.com/renderedtext/render_async/commits?author=nikolalsvk "Documentation") [π](#review-nikolalsvk "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/3866868?v=4" width="100px;"/><br /><sub><b>Colin</b></sub>](http://www.colinxfleming.com)<br />[π»](https://github.com/renderedtext/render_async/commits?author=colinxfleming "Code") [π](https://github.com/renderedtext/render_async/commits?author=colinxfleming "Documentation") [π‘](#example-colinxfleming "Examples") | [<img src="https://avatars2.githubusercontent.com/u/334273?v=4" width="100px;"/><br /><sub><b>Kasper Grubbe</b></sub>](http://kaspergrubbe.com)<br />[π»](https://github.com/renderedtext/render_async/commits?author=kaspergrubbe "Code") | [<img src="https://avatars2.githubusercontent.com/u/163584?v=4" width="100px;"/><br /><sub><b>Sai Ram Kunala</b></sub>](https://sairam.xyz/)<br />[π](https://github.com/renderedtext/render_async/commits?author=sairam "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/3065882?v=4" width="100px;"/><br /><sub><b>Josh Arnold</b></sub>](https://github.com/nightsurge)<br />[π»](https://github.com/renderedtext/render_async/commits?author=nightsurge "Code") [π](https://github.com/renderedtext/render_async/commits?author=nightsurge "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/107798?v=4" width="100px;"/><br /><sub><b>Elad Shahar</b></sub>](https://eladshahar.com)<br />[π»](https://github.com/renderedtext/render_async/commits?author=SaladFork "Code") [π‘](#example-SaladFork "Examples") | [<img src="https://avatars3.githubusercontent.com/u/232392?v=4" width="100px;"/><br /><sub><b>Sasha</b></sub>](http://www.revzin.co.il)<br />[π»](https://github.com/renderedtext/render_async/commits?author=sasharevzin "Code") [π](https://github.com/renderedtext/render_async/commits?author=sasharevzin "Documentation") |
|
505
511
|
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
506
512
|
| [<img src="https://avatars3.githubusercontent.com/u/50223?v=4" width="100px;"/><br /><sub><b>Ernest Surudo</b></sub>](http://elsurudo.com)<br />[π»](https://github.com/renderedtext/render_async/commits?author=elsurudo "Code") | [<img src="https://avatars1.githubusercontent.com/u/334809?v=4" width="100px;"/><br /><sub><b>Kurtis Rainbolt-Greene</b></sub>](https://kurtis.rainbolt-greene.online)<br />[π»](https://github.com/renderedtext/render_async/commits?author=krainboltgreene "Code") | [<img src="https://avatars2.githubusercontent.com/u/59744?v=4" width="100px;"/><br /><sub><b>Richard Schneeman</b></sub>](https://www.schneems.com)<br />[π](https://github.com/renderedtext/render_async/commits?author=schneems "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/75705?v=4" width="100px;"/><br /><sub><b>Richard Venneman</b></sub>](https://www.cityspotters.com)<br />[π](https://github.com/renderedtext/render_async/commits?author=richardvenneman "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/381395?v=4" width="100px;"/><br /><sub><b>Filipe W. Lima</b></sub>](https://github.com/filipewl)<br />[π](https://github.com/renderedtext/render_async/commits?author=filipewl "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/3135638?v=4" width="100px;"/><br /><sub><b>JesΓΊs Eduardo Clemens Chong</b></sub>](https://github.com/eclemens)<br />[π»](https://github.com/renderedtext/render_async/commits?author=eclemens "Code") | [<img src="https://avatars3.githubusercontent.com/u/1935686?v=4" width="100px;"/><br /><sub><b>RenΓ© KlaΔan</b></sub>](https://github.com/reneklacan)<br />[π»](https://github.com/renderedtext/render_async/commits?author=reneklacan "Code") |
|
507
|
-
| [<img src="https://avatars1.githubusercontent.com/u/1313442?v=4" width="100px;"/><br /><sub><b>Gil Gomes</b></sub>](http://gilgomes.com.br)<br />[π](https://github.com/renderedtext/render_async/commits?author=gil27 "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/6081795?v=4" width="100px;"/><br /><sub><b>Khoa Nguyen</b></sub>](https://github.com/ThanhKhoaIT)<br />[π»](https://github.com/renderedtext/render_async/commits?author=ThanhKhoaIT "Code") [π](https://github.com/renderedtext/render_async/commits?author=ThanhKhoaIT "Documentation") |
|
513
|
+
| [<img src="https://avatars1.githubusercontent.com/u/1313442?v=4" width="100px;"/><br /><sub><b>Gil Gomes</b></sub>](http://gilgomes.com.br)<br />[π](https://github.com/renderedtext/render_async/commits?author=gil27 "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/6081795?v=4" width="100px;"/><br /><sub><b>Khoa Nguyen</b></sub>](https://github.com/ThanhKhoaIT)<br />[π»](https://github.com/renderedtext/render_async/commits?author=ThanhKhoaIT "Code") [π](https://github.com/renderedtext/render_async/commits?author=ThanhKhoaIT "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/8645918?v=4" width="100px;"/><br /><sub><b>Preet Sethi</b></sub>](https://www.linkedin.com/in/preetsethila/)<br />[π»](https://github.com/renderedtext/render_async/commits?author=preetsethi "Code") |
|
508
514
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
509
515
|
|
510
516
|
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
data/lib/render_async/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_async
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Grubbe
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-08-
|
12
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|