turbo_modal 0.3.1 → 0.3.2
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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: '0078dc10ef887436764ed4b1dd676e73ada176603190f8d8eb8eb02bd19837c5'
         | 
| 4 | 
            +
              data.tar.gz: 777a55c156dd52f49b66b8eec882a7d093dbd5e3b7f9884bf4999eacbdb00d38
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 3f19861545c075e19cad1f516c05e022ee7fed7b64825e922b4c62fbc4f8a65ef59525db850fe6488cc26a89da3555c39493abc4fee8f78871025a0b503c7a2c
         | 
| 7 | 
            +
              data.tar.gz: dd29b5c61a67d68721cc57a4806b0f62cf15c421444598981074d258767a727840774769e0d920655cccd40a4af2d6a474f42f82ebf88b1114aef9b4b15d0a7d
         | 
| @@ -19,7 +19,7 @@ class ModalController extends Controller { | |
| 19 19 | 
             
              open(e) {
         | 
| 20 20 | 
             
                this.turboFrameTarget.src = e.detail.url;
         | 
| 21 21 | 
             
                this.typeValue = e.detail.type;
         | 
| 22 | 
            -
                showScrim();
         | 
| 22 | 
            +
                showScrim(e.detail.dismiss);
         | 
| 23 23 | 
             
              }
         | 
| 24 24 |  | 
| 25 25 | 
             
              close(e) {
         | 
| @@ -50,8 +50,8 @@ class ModalController extends Controller { | |
| 50 50 | 
             
            /**
         | 
| 51 51 | 
             
             * Show a modal, requires a url for a page that renders a turbo-frame with id `modal`.
         | 
| 52 52 | 
             
             */
         | 
| 53 | 
            -
            function openModal(url, type = "") {
         | 
| 54 | 
            -
              window.dispatchEvent(new CustomEvent("modal:open", { detail: { url: url, type: type }}));
         | 
| 53 | 
            +
            function openModal(url, type = "", dismiss = true) {
         | 
| 54 | 
            +
              window.dispatchEvent(new CustomEvent("modal:open", { detail: { url: url, type: type, dismiss: dismiss }}));
         | 
| 55 55 | 
             
            }
         | 
| 56 56 |  | 
| 57 57 | 
             
            /**
         | 
| @@ -17,6 +17,10 @@ class ScrimController extends Controller { | |
| 17 17 | 
             
                delete this.scrimTarget.dataset.hidden;
         | 
| 18 18 | 
             
                document.body.style.height = "100vh";
         | 
| 19 19 | 
             
                document.body.style.overflow = "hidden";
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                if (!event.detail.dismiss) {
         | 
| 22 | 
            +
                  this.scrimTarget.style.pointerEvents = "none";
         | 
| 23 | 
            +
                }
         | 
| 20 24 | 
             
              }
         | 
| 21 25 |  | 
| 22 26 | 
             
              hide(event) {
         | 
| @@ -39,8 +43,8 @@ class ScrimController extends Controller { | |
| 39 43 | 
             
            /**
         | 
| 40 44 | 
             
             * Show the scrim element
         | 
| 41 45 | 
             
             */
         | 
| 42 | 
            -
            function showScrim() {
         | 
| 43 | 
            -
              window.dispatchEvent(new  | 
| 46 | 
            +
            function showScrim(dismiss = true) {
         | 
| 47 | 
            +
              window.dispatchEvent(new CustomEvent("scrim:show", { detail: { dismiss: dismiss }}));
         | 
| 44 48 | 
             
            }
         | 
| 45 49 |  | 
| 46 50 | 
             
            /**
         | 
    
        data/lib/turbo_modal/version.rb
    CHANGED
    
    
    
        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 | 
            +
              version: 0.3.2
         | 
| 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- | 
| 12 | 
            +
            date: 2022-05-10 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: rails
         |