turbolinks-form 0.0.2 → 0.0.3
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/app/assets/javascripts/turbolinks-form-core.js +13 -0
- data/lib/turbolinks/form/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d71f9d88ffc2e745e92ddc03bac798ef0d1e36c2
|
4
|
+
data.tar.gz: e7ba11e51ec43b66a3737f7a229a559e5c58dc1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44686ec2b5e7f2c004128f536e640a9a012e6d1d665949cbfe1f085bfb284d0dd5d99994b66d71783f4b63d111f72bbfec5544a91fd930afedd80a3b21ca17f1
|
7
|
+
data.tar.gz: f62d2619e59a503fdd3a8d1384b3694e8692077544ee6615b36517cb96a9793e20986fa1d5a0ae30e49086b9a71d94dd06c7afa5bf2bb98b2a02db6911c87b10
|
@@ -24,6 +24,19 @@ $(function() {
|
|
24
24
|
// parses response
|
25
25
|
var newDom = new DOMParser().parseFromString(response.responseText, "text/html");
|
26
26
|
|
27
|
+
// Some browsers (PhantomJS and earlier versions of Firefox and IE) don't implement
|
28
|
+
// parsing from string for "text/html" format. So we use an alternative method
|
29
|
+
// described here:
|
30
|
+
// https://developer.mozilla.org/en-US/Add-ons/Code_snippets/HTML_to_DOM#Parsing_Complete_HTML_to_DOM
|
31
|
+
if (newDom == null) {
|
32
|
+
newDom = document.implementation.createHTMLDocument("document");
|
33
|
+
newDom.documentElement.innerHTML = response.responseText;
|
34
|
+
}
|
35
|
+
|
36
|
+
if (newDom == null) {
|
37
|
+
console.error("turbolinks-form was not able to parse response from server.");
|
38
|
+
}
|
39
|
+
|
27
40
|
// dispatches turbolinks event
|
28
41
|
Turbolinks.dispatch('turbolinks:before-render', {data: {newBody: newDom.body}});
|
29
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbolinks-form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Gubert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|