turbo_modal 0.3.4 → 1.0.0

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: 109ad54770b4ca4dbf21878bc8c71b8cf26ab1419b94428c9b5e2f6f3039d6f6
4
- data.tar.gz: 53074315c672b7872ddf00f7eb450ea1f211258ec846afd885e43867e80cd6fd
3
+ metadata.gz: 3d997ed3ad3e39a767b70f528c25e38ab48b68a88c42df8de15b0ff4941374c7
4
+ data.tar.gz: 4edfe21786738df6e7227b2928fcf95c9c68acba962dc378218d2c6198e5654b
5
5
  SHA512:
6
- metadata.gz: c8b80f44d4a426e6b22e781c3b602c8a93b4e713e83ad5d19f2811fbdda5fb51534cc7e01a8fb708dece3dc8e1884f3c79b6bd56528f46a86875c48ef5bdd28b
7
- data.tar.gz: b70024cf95327a99d3efe987c1f446031fb2b35e233f993a5cb7e8c35be851b7607fd47c9e2633d01d0f85f27bbde6dae6456ff7bf427f61368fefb53f57b9d9
6
+ metadata.gz: 8c1565c96f6f0cb2ce5ad468c85253605fe4a8eca18fb1da6df0815752a1fdd41c7b8752b04e8e30c3166a09cdb72fbb6d0c8f74944a76648065d4559132a5f9
7
+ data.tar.gz: ed617be97210460c0669fc609abf8eb60bea10978944f65764f8476b5541318115165a8f4a96b7091327df68af1c2d22eb7ccda507bbe3474cb1fae699f1da4f
@@ -30,7 +30,7 @@
30
30
  pointer-events: auto;
31
31
  margin: 2rem;
32
32
 
33
- @media screen and(max-width: 45rem) {
33
+ @media screen and (max-width: 45rem) {
34
34
  min-width: 100%;
35
35
  }
36
36
 
@@ -40,7 +40,7 @@
40
40
  }
41
41
 
42
42
  .fullscreen & {
43
- @media screen and(max-width: 45rem) {
43
+ @media screen and (max-width: 45rem) {
44
44
  margin: 0;
45
45
  border-radius: 0;
46
46
  height: 100%;
@@ -57,7 +57,7 @@
57
57
  --animation-in : slide-up;
58
58
  --animation-out : slide-down;
59
59
 
60
- @media screen and(max-width: 45rem) {
60
+ @media screen and (max-width: 45rem) {
61
61
  min-height: 65vh;
62
62
  }
63
63
  }
@@ -68,7 +68,7 @@
68
68
  animation-duration: 0.25s;
69
69
 
70
70
  .fullscreen & {
71
- @media screen and(max-width: 45rem) {
71
+ @media screen and (max-width: 45rem) {
72
72
  --animation-in: slide-in-left;
73
73
  }
74
74
  }
@@ -80,7 +80,7 @@
80
80
  animation-fill-mode: forwards;
81
81
 
82
82
  .fullscreen & {
83
- @media screen and(max-width: 45rem) {
83
+ @media screen and (max-width: 45rem) {
84
84
  --animation-out: slide-out-right;
85
85
  }
86
86
  }
@@ -19,6 +19,9 @@ class ModalController extends Controller {
19
19
  open(e) {
20
20
  this.turboFrameTarget.src = e.detail.url;
21
21
  this.typeValue = e.detail.type;
22
+ if (event.detail.dismissable) {
23
+ this.turboFrameTarget.dataset.dismissable = "";
24
+ }
22
25
  showScrim(e.detail.dismiss);
23
26
  }
24
27
 
@@ -31,6 +34,7 @@ class ModalController extends Controller {
31
34
  setTimeout(() => {
32
35
  modal_element.remove();
33
36
  this.turboFrameTarget.src = null;
37
+ delete this.turboFrameTarget.dataset.dismissable;
34
38
 
35
39
  if (this.typeValue !== "") {
36
40
  this.turboFrameTarget.classList.remove(this.typeValue);
@@ -41,7 +45,7 @@ class ModalController extends Controller {
41
45
  }
42
46
 
43
47
  keyup(event) {
44
- if (event.key === "Escape") {
48
+ if (event.key === "Escape" && this.turboFrameTarget.dataset.dismissable === "") {
45
49
  closeModal();
46
50
  }
47
51
  }
@@ -28,7 +28,7 @@ class ScrimController extends Controller {
28
28
  }
29
29
 
30
30
  onClick(event) {
31
- if (this.scrimTarget.dataset.dismissable) {
31
+ if (this.scrimTarget.dataset.dismissable === "") {
32
32
  window.dispatchEvent(new Event("scrim:hide"));
33
33
  }
34
34
  }
@@ -1,3 +1,3 @@
1
1
  module TurboModal
2
- VERSION = "0.3.4".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_modal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Cornthwaite
8
8
  - Matt Redmond
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-05-31 00:00:00.000000000 Z
12
+ date: 2023-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -76,7 +76,7 @@ metadata:
76
76
  homepage_uri: https://github.com/katalyst/turbo_modal
77
77
  source_code_uri: https://github.com/katalyst/turbo_modal
78
78
  changelog_uri: https://github.com/katalyst/turbo_modal
79
- post_install_message:
79
+ post_install_message:
80
80
  rdoc_options: []
81
81
  require_paths:
82
82
  - lib
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubygems_version: 3.1.6
95
- signing_key:
95
+ signing_key:
96
96
  specification_version: 4
97
97
  summary: Modal library that uses Turbo and Stimulus because we are in the future now.
98
98
  test_files: []