lato 0.1.5 → 0.1.7

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: 9d29cd164f2420466a67c8580ac6e282ecf4f55eacbb8872d56fb0e3790c7bcc
4
- data.tar.gz: 0c4bd6e62b8735a20334fb0caf4147d830d8f9c5559f6973fb9816f268f2d80f
3
+ metadata.gz: '068d1c201b840125377b8642cd80521f5a0a4666e0b1610dd5652e3cddd3bbb3'
4
+ data.tar.gz: 2cbe84bb4f4c2f9de5ea1784bd0bcfed5895a1b0d904f9ab5338f90897cca601
5
5
  SHA512:
6
- metadata.gz: 22329d6c82353876aa4cab0adebf44837e6d44cb2303e66c78c4ea0b16c23d74001103816e7115dccbea37d27c2ee885d206d47f362b27992cbb4a8e2ef0cf4c
7
- data.tar.gz: fa749af16891fbea3c7b460e8a5938bc259ad776f1154a6951d8e44c199502fe7708bcb04d4812f346271b52481b30309a5e556121a93c2bc54bae0c602bc459
6
+ metadata.gz: db9aabc6b8fa9d03b0267112d34f89ad6724caadcdf3f2b7d7c070fa2197e182e8511f91c479280d128d38b172767916870823af3d147b7387fd7dbbd4ee511c
7
+ data.tar.gz: eb095e507554d867bd6ea8d24a3639bf507cac2e3e80b58c3ab64f96164f66b4cfd96fe1d8134450c1ba3cc0a85d5b588696eaf07e1b0dadcb153171a20d34d1
data/README.md CHANGED
@@ -98,4 +98,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
98
98
 
99
99
  ## To do
100
100
  - Gestione abbonamenti e acquisti singoli con integrazione Stripe
101
- - Gestione input file operazione
101
+ - Gestione input file operazione
@@ -22,18 +22,46 @@ export default class extends Controller {
22
22
 
23
23
  modalTarget.addEventListener('show.bs.modal', () => {
24
24
  this.usedModals.push(index)
25
+
26
+ // update backdrop z-index in case of multiple opened modals
27
+ setTimeout(() => { // use setTimeout because bsModalBackdropElement is not always ready after 'show.bs.modal' event
28
+ if (this.usedModals.length > 1) {
29
+ for (let i = 0; i < this.usedModals.length; i++) {
30
+ const bsModal = this.bsModals[this.usedModals[i]]
31
+
32
+ const bsModalElement = bsModal._element
33
+ if (bsModalElement) bsModalElement.style.zIndex = 1055 + i + 1
34
+
35
+ const bsModalBackdropElement = bsModal._backdrop._element
36
+ if (bsModalBackdropElement) bsModalBackdropElement.style.zIndex = 1055 + i
37
+ }
38
+ }
39
+ }, 1)
25
40
  })
26
41
  modalTarget.addEventListener('hide.bs.modal', () => {
27
- this.usedModals = this.usedModals.filter((i) => i != index)
28
- this.modalBodyTargets[index].innerHTML = ''
42
+ setTimeout(() => {
43
+ this.usedModals = this.usedModals.filter((i) => i != index)
44
+ this.modalBodyTargets[index].innerHTML = ''
45
+ }, 500)
29
46
  })
30
47
  })
31
48
  }
32
49
 
33
50
  disconnect() {
51
+ // call dispose to all bootstrap modals (clear bootstrap modal)
34
52
  this.bsModals.forEach((bsModal) => {
35
53
  bsModal.dispose()
36
54
  })
55
+
56
+ // clean modalTitle content
57
+ this.modalTitleTargets.forEach((modalTitleTarget) => {
58
+ modalTitleTarget.innerHTML = ''
59
+ })
60
+
61
+ // clean modalBody content
62
+ this.modalBodyTargets.forEach((modalBodyTarget) => {
63
+ modalBodyTarget.innerHTML = ''
64
+ })
37
65
  }
38
66
 
39
67
  triggerTargetConnected(element) {
@@ -12,12 +12,16 @@ export default class extends Controller {
12
12
 
13
13
  connect() {
14
14
  if (this.hasUpdateTarget) {
15
- setTimeout(() => {
15
+ this._timeout = setTimeout(() => {
16
16
  this.updateTarget.click()
17
17
  }, 2000)
18
18
  }
19
19
  }
20
20
 
21
+ disconnect() {
22
+ if (this._timeout) clearTimeout(this._timeout)
23
+ }
24
+
21
25
  outputFileTargetConnected(element) {
22
26
  element.click()
23
27
  }
@@ -1,4 +1,4 @@
1
- <%= turbo_frame_tag "lato_index_#{key}_#{model_name_underscore}" do %>
1
+ <%= turbo_frame_tag "lato_index_#{key}_#{model_name_underscore}", class: 'lato-index' do %>
2
2
 
3
3
  <%= form_tag request.path, method: :get, data: { turbo_frame: '_self' } do %>
4
4
  <%= hidden_field_tag :key, key %>
@@ -1 +1,6 @@
1
- <%= Lato.config.application_title %>
1
+ <%= Lato.config.application_title %>
2
+
3
+ <!--
4
+ <img src="https://getbootstrap.com/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="30" height="24" class="d-inline-block align-text-top">
5
+ <span><%= Lato.config.application_title %></span>
6
+ -->
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-25 00:00:00.000000000 Z
11
+ date: 2022-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails