turbo-rails 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/turbo.js +15 -8
- data/lib/turbo/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: c262e76eb847e212773e7befcc963473e87b06f2bf01eefdff938cff52eb1779
|
4
|
+
data.tar.gz: ced8870cfb3301bcd13b551f47bf327400780e9a72844547a482ff3207ca4481
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29ef07542ceea019544fc6ecc3598452c21122d271c5805d211f2d932d449dc9288d09adaaf9ffcc910ddb1ab2feb53174a39adf8e80515efbe61eb2fde4833d
|
7
|
+
data.tar.gz: 12685cf32b4aef76070124bb52705b508363f330d7e465e7466c3a727d07c8b0299c15f315297390b0561b6881d5310e4e60e656fe7fe1337f3cfa3fcd5f854c
|
@@ -30,10 +30,17 @@ function clickCaptured(event) {
|
|
30
30
|
}
|
31
31
|
|
32
32
|
(function() {
|
33
|
-
if ("SubmitEvent" in window) return;
|
34
33
|
if ("submitter" in Event.prototype) return;
|
34
|
+
let prototype;
|
35
|
+
if ("SubmitEvent" in window && /Apple Computer/.test(navigator.vendor)) {
|
36
|
+
prototype = window.SubmitEvent.prototype;
|
37
|
+
} else if ("SubmitEvent" in window) {
|
38
|
+
return;
|
39
|
+
} else {
|
40
|
+
prototype = window.Event.prototype;
|
41
|
+
}
|
35
42
|
addEventListener("click", clickCaptured, true);
|
36
|
-
Object.defineProperty(
|
43
|
+
Object.defineProperty(prototype, "submitter", {
|
37
44
|
get() {
|
38
45
|
if (this.type == "submit" && this.target instanceof HTMLFormElement) {
|
39
46
|
return submittersByForm.get(this.target);
|
@@ -734,8 +741,8 @@ class Snapshot {
|
|
734
741
|
class FormInterceptor {
|
735
742
|
constructor(delegate, element) {
|
736
743
|
this.submitBubbled = event => {
|
737
|
-
|
738
|
-
|
744
|
+
const form = event.target;
|
745
|
+
if (form instanceof HTMLFormElement && form.closest("turbo-frame, html") == this.element) {
|
739
746
|
const submitter = event.submitter || undefined;
|
740
747
|
if (this.delegate.shouldInterceptFormSubmission(form, submitter)) {
|
741
748
|
event.preventDefault();
|
@@ -2593,7 +2600,7 @@ class Session {
|
|
2593
2600
|
this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);
|
2594
2601
|
}
|
2595
2602
|
willSubmitForm(form, submitter) {
|
2596
|
-
return this.elementDriveEnabled(form) && this.elementDriveEnabled(submitter);
|
2603
|
+
return this.elementDriveEnabled(form) && (!submitter || this.elementDriveEnabled(submitter));
|
2597
2604
|
}
|
2598
2605
|
formSubmitted(form, submitter) {
|
2599
2606
|
this.navigator.submitForm(form, submitter);
|
@@ -2752,7 +2759,7 @@ const deprecatedLocationPropertyDescriptors = {
|
|
2752
2759
|
|
2753
2760
|
const session = new Session;
|
2754
2761
|
|
2755
|
-
const {navigator: navigator} = session;
|
2762
|
+
const {navigator: navigator$1} = session;
|
2756
2763
|
|
2757
2764
|
function start() {
|
2758
2765
|
session.start();
|
@@ -2788,7 +2795,7 @@ function setProgressBarDelay(delay) {
|
|
2788
2795
|
|
2789
2796
|
var Turbo = Object.freeze({
|
2790
2797
|
__proto__: null,
|
2791
|
-
navigator: navigator,
|
2798
|
+
navigator: navigator$1,
|
2792
2799
|
session: session,
|
2793
2800
|
PageRenderer: PageRenderer,
|
2794
2801
|
PageSnapshot: PageSnapshot,
|
@@ -3263,7 +3270,7 @@ var turbo_es2017Esm = Object.freeze({
|
|
3263
3270
|
clearCache: clearCache,
|
3264
3271
|
connectStreamSource: connectStreamSource,
|
3265
3272
|
disconnectStreamSource: disconnectStreamSource,
|
3266
|
-
navigator: navigator,
|
3273
|
+
navigator: navigator$1,
|
3267
3274
|
registerAdapter: registerAdapter,
|
3268
3275
|
renderStreamMessage: renderStreamMessage,
|
3269
3276
|
session: session,
|
data/lib/turbo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-09-
|
13
|
+
date: 2021-09-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|