turbo_modal 0.3.4 → 0.3.5

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: 1784474a3a799b2c623b1705a5cf0df011bd809287a81342ceb605fc29930ef3
4
+ data.tar.gz: 733288280786b1cd6c8463db2351101fbfe7e668f05ac4e0f6367a4309c8b438
5
5
  SHA512:
6
- metadata.gz: c8b80f44d4a426e6b22e781c3b602c8a93b4e713e83ad5d19f2811fbdda5fb51534cc7e01a8fb708dece3dc8e1884f3c79b6bd56528f46a86875c48ef5bdd28b
7
- data.tar.gz: b70024cf95327a99d3efe987c1f446031fb2b35e233f993a5cb7e8c35be851b7607fd47c9e2633d01d0f85f27bbde6dae6456ff7bf427f61368fefb53f57b9d9
6
+ metadata.gz: 28206680aa24756513e5e593cc601cb55b56642b56d67ff826ffff8e55dd7dcaa23904e36aa7c74c1b40a22b2451bbf2edcfb4118766b9a2dab97d37549cbb46
7
+ data.tar.gz: fddf55d488c5a7f3b1e9953550c9b054cf47e42c0895ea342a2f9d6ffd6cef947a2037532d45d941012e7d689030ddb6a2288ef9e58a292b1196c41c1b4b38ba
@@ -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 = "0.3.5".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Cornthwaite
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-05-31 00:00:00.000000000 Z
12
+ date: 2022-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails