render_async 2.1.1 β†’ 2.1.2

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: df5daf3d85a8c231ffb42b131e132c5ccb3ee05a7fa4d907d4c4a7d7f0ca9933
4
- data.tar.gz: ad4e99c2355a33754f2f2a0136a8994ee8da70f50071b0374de834eb07b1dd3d
3
+ metadata.gz: 9b91f800c218048a1e608c413909a1f9e55ae5a7ec450937d645f49526ac478c
4
+ data.tar.gz: a0675247df2c42dba16036c548e13f5443234724326e09ca2aa619cfa807f3bf
5
5
  SHA512:
6
- metadata.gz: '058d8eb219d8230a096d6da70884a35b239158023b69d1d7968ead8f4cd9dcdaa465be6e3de9773c03520ca1541b71f7181b7dd830953f36ab6de6b1f2855554'
7
- data.tar.gz: 3c4949c59e023411ae1e467681ffdeeab49be312c2f5909be299519d529773f32db8237b568c473c08cca2eb371633a8748077faa8bb2f956474712a9a332424
6
+ metadata.gz: e26aa8dda9a9e5cfb9b4617999bc7a6a80671bb11ee0cb3d7519f8ad3d03e6154370bf46f95c4cd9eefa3ae23b1643a99014d5501a2ea8008c8ad760b7e59801
7
+ data.tar.gz: c4f3aa9fe15e413df9ea442c8c7bd778aee560ef87a2af16973645eb3db2bedac4e2b3c944f06c737cf2371b07e35576a57823da4942db2687a04c064f33e4bb
@@ -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"
@@ -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
  [![Build Status](https://semaphoreci.com/api/v1/renderedtext/render_async/branches/master/shields_badge.svg)](https://semaphoreci.com/renderedtext/render_async)
2
- [![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors)
2
+ [![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors)
3
3
  [![Gem Version](https://badge.fury.io/rb/render_async.svg)](https://badge.fury.io/rb/render_async)
4
4
  [![Code Climate](https://codeclimate.com/github/renderedtext/render_async/badges/gpa.svg)](https://codeclimate.com/github/renderedtext/render_async)
5
5
  [![Test Coverage](https://codeclimate.com/github/renderedtext/render_async/badges/coverage.svg)](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
- If you want to call `render_async` on click or another event you can specify.
259
- If you don't specifiy an event name, the default would be 'click' event. You
260
- can do this by doing the following:
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'>detail</a>
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'>detail</a>
277
+ <a href='#' id='detail-button'>Detail</a>
274
278
  <% end %>
275
279
  ```
276
280
 
277
- Also, you can mix interval and toggle features like this:
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'>detail</a>
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!
@@ -95,7 +95,7 @@ if (window.jQuery) {
95
95
  });
96
96
  <% end %>
97
97
 
98
- <% if turbolinks %>
98
+ <% if turbolinks && !toggle %>
99
99
  $(document).one('turbolinks:load', _renderAsyncFunction);
100
100
  <% elsif !toggle %>
101
101
  $(document).ready(_renderAsyncFunction);
@@ -112,7 +112,7 @@
112
112
  });
113
113
  <% end %>
114
114
 
115
- <% if turbolinks %>
115
+ <% if turbolinks && !toggle %>
116
116
  document.addEventListener("turbolinks:load", function (e) {
117
117
  e.target.removeEventListener(e.type, arguments.callee);
118
118
  _renderAsyncFunction();
@@ -1,3 +1,3 @@
1
1
  module RenderAsync
2
- VERSION = "2.1.1".freeze
2
+ VERSION = "2.1.2".freeze
3
3
  end
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.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-16 00:00:00.000000000 Z
12
+ date: 2019-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake