render_async 2.1.9 β†’ 2.1.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6efd10ad97f50cae5b58a0ff6042df5c0b9f5ed0b27ca1a498f4cdb84172ab79
4
- data.tar.gz: 8daab586cb6b11d66bc873e12929ee2bb1162a6b5578e343ddeb6f03c1094c71
3
+ metadata.gz: 4c2458365f2d0d1c95a9356e4076e483b41e58518a6c0496d0b2d20c8a0c1e44
4
+ data.tar.gz: 9fce775541e8e12fe742a0ec03dfb52a92f47ac70c953442d74e612f721d0480
5
5
  SHA512:
6
- metadata.gz: aaa98a754f9cbce70521702793d6307fbb976b064a9b981a7a5c43db5dd12527cfa81f5a07269476958f12ae0f0f2a79a4038236146cda6a2bfc2e23b3c36fbf
7
- data.tar.gz: db95a549cd0d1f3ee086ad35634cf53f94e615de679dd201a543432337e99de43cf9b080d9c10296a0e1e2391e48bedf16717fd868fe7ec7ecae3c35ce7bb384
6
+ metadata.gz: c1a00f85f23df409ba9a505c963359979512c32110096a3b7bf5431942a0a8274711fc2000a909f379d76a921548854bb3bc005e0cc6f6a31b8f46d94692c6f2
7
+ data.tar.gz: 8aab5df90bf0db84a3c4c82adf6eec772de19b553b9bdcd0d08646fdd20f522eb4cc4d41e7ef335aa856557e8f892cd8f3d7f2507938f042d8f0eaf3988bff75
data/.all-contributorsrc CHANGED
@@ -224,6 +224,16 @@
224
224
  "code",
225
225
  "doc"
226
226
  ]
227
+ },
228
+ {
229
+ "login": "yhirano55",
230
+ "name": "yhirano55",
231
+ "avatar_url": "https://avatars.githubusercontent.com/u/15371677?v=4",
232
+ "profile": "https://github.com/yhirano55",
233
+ "contributions": [
234
+ "code",
235
+ "doc"
236
+ ]
227
237
  }
228
238
  ],
229
239
  "repoType": "github"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ### 2.1.10 (2021/03/21)
2
+
3
+ * [#146](https://github.com/renderedtext/render_async/pull/146): Add comment when we check if container is present - [@nikolalsvk](https://github.com/nikolalsvk).
4
+ * [#145](https://github.com/renderedtext/render_async/pull/145): Wrap html_options for turbolinks - [@yhirano55](https://github.com/yhirano55).
5
+ * [#144](https://github.com/renderedtext/render_async/pull/144): Avoid TypeError if container has already disappear - [@yhirano55](https://github.com/yhirano55).
6
+
7
+ ### 2.1.9 (2021/02/23)
8
+
9
+ * [#142](https://github.com/renderedtext/render_async/pull/142): Update Turbolinks docs - [@nikolalsvk](https://github.com/nikolalsvk).
10
+ * [#141](https://github.com/renderedtext/render_async/pull/141): Add Support for Turbo - [@MBuckley0](https://github.com/Mbuckley0).
11
+ * [#139](https://github.com/renderedtext/render_async/pull/139): Fix readme configuration-options anchor - [@richardvenneman](https://github.com/richardvenneman).
12
+ * [#138](https://github.com/renderedtext/render_async/pull/138): Add Rails 6 base app as a fixture - [@nikolalsvk](https://github.com/nikolalsvk).
13
+ * [#137](https://github.com/renderedtext/render_async/pull/137): Rename config - [@nikolalsvk](https://github.com/nikolalsvk).
14
+
1
15
  ### 2.1.8 (2020/10/24)
2
16
 
3
17
  * [#134](https://github.com/renderedtext/render_async/pull/134): Add config option for setting nonce - [@nikolalsvk](https://github.com/nikolalsvk).
data/README.md CHANGED
@@ -622,7 +622,7 @@ Another option:
622
622
  If you want, you can tell Turbolinks to reload your `render_async` call as follows:
623
623
 
624
624
  ```erb
625
- <%= render_async events_path, 'data-turbolinks-track': 'reload' %>
625
+ <%= render_async events_path, html_options: { 'data-turbolinks-track': 'reload' } %>
626
626
  ```
627
627
 
628
628
  This will reload the whole page with Turbolinks.
@@ -652,7 +652,7 @@ Another option:
652
652
  If you want, you can tell Turbo to reload your `render_async` call as follows:
653
653
 
654
654
  ```erb
655
- <%= render_async events_path, 'data-turbo-track': 'reload' %>
655
+ <%= render_async events_path, html_options: { 'data-turbo-track': 'reload' } %>
656
656
  ```
657
657
 
658
658
  This will reload the whole page with Turbo.
@@ -796,7 +796,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
796
796
  | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
797
797
  | [<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") |
798
798
  | [<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") | [<img src="https://avatars3.githubusercontent.com/u/11586335?v=4" width="100px;"/><br /><sub><b>fangxing</b></sub>](https://github.com/fffx)<br />[πŸ’»](https://github.com/renderedtext/render_async/commits?author=fffx "Code") | [<img src="https://avatars3.githubusercontent.com/u/1191418?v=4" width="100px;"/><br /><sub><b>Emmanuel Pire</b></sub>](http://blog.lipsumarium.com)<br />[πŸ’»](https://github.com/renderedtext/render_async/commits?author=lipsumar "Code") [πŸ“–](https://github.com/renderedtext/render_async/commits?author=lipsumar "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/615509?v=4" width="100px;"/><br /><sub><b>Maxim Geerinck</b></sub>](https://github.com/maximgeerinck)<br />[πŸ’»](https://github.com/renderedtext/render_async/commits?author=maximgeerinck "Code") | [<img src="https://avatars1.githubusercontent.com/u/251706?v=4" width="100px;"/><br /><sub><b>Don</b></sub>](https://github.com/vanboom)<br />[πŸ’»](https://github.com/renderedtext/render_async/commits?author=vanboom "Code") |
799
- | [<img src="https://avatars0.githubusercontent.com/u/998682?v=4" width="100px;"/><br /><sub><b>villu164</b></sub>](https://github.com/villu164)<br />[πŸ“–](https://github.com/renderedtext/render_async/commits?author=villu164 "Documentation") | [<img src="https://avatars.githubusercontent.com/u/11203679?v=4" width="100px;"/><br /><sub><b>Mitchell Buckley</b></sub>](https://github.com/Mbuckley0)<br />[πŸ’»](https://github.com/renderedtext/render_async/commits?author=Mbuckley0 "Code") [πŸ“–](https://github.com/renderedtext/render_async/commits?author=Mbuckley0 "Documentation") |
799
+ | [<img src="https://avatars0.githubusercontent.com/u/998682?v=4" width="100px;"/><br /><sub><b>villu164</b></sub>](https://github.com/villu164)<br />[πŸ“–](https://github.com/renderedtext/render_async/commits?author=villu164 "Documentation") | [<img src="https://avatars.githubusercontent.com/u/11203679?v=4" width="100px;"/><br /><sub><b>Mitchell Buckley</b></sub>](https://github.com/Mbuckley0)<br />[πŸ’»](https://github.com/renderedtext/render_async/commits?author=Mbuckley0 "Code") [πŸ“–](https://github.com/renderedtext/render_async/commits?author=Mbuckley0 "Documentation") | [<img src="https://avatars.githubusercontent.com/u/15371677?v=4" width="100px;"/><br /><sub><b>yhirano55</b></sub>](https://github.com/yhirano55)<br />[πŸ’»](https://github.com/renderedtext/render_async/commits?author=yhirano55 "Code") [πŸ“–](https://github.com/renderedtext/render_async/commits?author=yhirano55 "Documentation") |
800
800
  <!-- ALL-CONTRIBUTORS-LIST:END -->
801
801
 
802
802
  This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
@@ -50,6 +50,10 @@ if (window.jQuery) {
50
50
  headers: headers
51
51
  }).done(function(response) {
52
52
  var container = $("#<%= container_id %>");
53
+
54
+ // If user navigated away before the request completed
55
+ if (!container.length) return;
56
+
53
57
  <% if !interval && replace_container %>
54
58
  container.replaceWith(response);
55
59
  <% else %>
@@ -73,6 +77,8 @@ if (window.jQuery) {
73
77
  if (skipErrorMessage) return;
74
78
 
75
79
  var container = $("#<%= container_id %>");
80
+ if (!container.length) return;
81
+
76
82
  container.replaceWith("<%= error_message.try(:html_safe) %>");
77
83
 
78
84
  var errorEvent = createEvent(
@@ -60,6 +60,10 @@
60
60
  if (request.readyState === 4) {
61
61
  if (request.status >= SUCCESS && request.status < ERROR) {
62
62
  var container = document.getElementById('<%= container_id %>');
63
+
64
+ // If user navigated away before the request completed
65
+ if (!container) return;
66
+
63
67
  <% if !interval && replace_container %>
64
68
  container.outerHTML = request.response;
65
69
  <% else %>
@@ -82,6 +86,8 @@
82
86
  if (skipErrorMessage) return;
83
87
 
84
88
  var container = document.getElementById('<%= container_id %>');
89
+ if (!container) return;
90
+
85
91
  container.outerHTML = '<%= error_message.try(:html_safe) %>';
86
92
 
87
93
  var errorEvent = createEvent(
@@ -1,3 +1,3 @@
1
1
  module RenderAsync
2
- VERSION = "2.1.9".freeze
2
+ VERSION = "2.1.10".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.9
4
+ version: 2.1.10
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: 2021-02-23 00:00:00.000000000 Z
12
+ date: 2021-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake