pg_rails 7.3.3 → 7.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_associable/app/javascript/modal_controller.js +4 -2
- data/pg_engine/app/components/asociable_modal_component.html.slim +1 -0
- data/pg_engine/app/components/modal_component.html.slim +3 -2
- data/pg_engine/app/components/modal_component.rb +6 -1
- data/pg_rails/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b6625d4eea069719a53935223e89933c45ea8193b707a0a601646cf1c7d4d28
|
4
|
+
data.tar.gz: 8fc921c742a0dd8c2d361b8844a36d04f92ca03617cec64dd178bf043ae11781
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42908b6091fa4b5d36cc10bcdc19c6665171c107f73c0dd7b2457355550e931e8bec5d212de311a8bb667090531506b2aab8ce30c101829566e8acd20b8f260f
|
7
|
+
data.tar.gz: deba07fbf28846fb3a536ebc4d0002965cc131c4ad6bb626d4242c49ba9a45d303ccd85ccebec6f75cbd8eab6c3dea58159588541db785f4320e4fbdff0f5c7e
|
@@ -9,12 +9,14 @@ export default class extends Controller {
|
|
9
9
|
|
10
10
|
connect (e) {
|
11
11
|
this.modalPuntero = new bootstrap.Modal(this.element)
|
12
|
-
if (this.element.dataset.removeOnHide) {
|
12
|
+
if (this.element.dataset.removeOnHide === 'true') {
|
13
13
|
this.element.addEventListener('hidden.bs.modal', (e) => {
|
14
14
|
this.element.remove()
|
15
15
|
})
|
16
16
|
}
|
17
|
-
this.
|
17
|
+
if (this.element.dataset.autoShow === 'true') {
|
18
|
+
this.modalPuntero.show()
|
19
|
+
}
|
18
20
|
|
19
21
|
this.element.addEventListener('turbo:frame-render', (ev) => {
|
20
22
|
if (ev.detail.fetchResponse.response.ok && ev.target.id === 'modal_content') {
|
@@ -1,5 +1,6 @@
|
|
1
|
-
.modal[class="#{@klass}" tabindex="-1" data-controller="modal"
|
2
|
-
data-remove-on-hide="
|
1
|
+
.modal[id="#{@id}" class="#{@klass}" tabindex="-1" data-controller="modal"
|
2
|
+
data-remove-on-hide="#{@remove_on_hide}" data-turbo-temporary="true"
|
3
|
+
data-auto-show="#{@auto_show}"]
|
3
4
|
.modal-dialog
|
4
5
|
.modal-content
|
5
6
|
= content
|
@@ -1,11 +1,16 @@
|
|
1
1
|
class ModalComponent < ViewComponent::Base
|
2
|
-
def initialize(klass: 'modal-xl')
|
2
|
+
def initialize(klass: 'modal-xl', id: nil, auto_show: true)
|
3
3
|
@klass = klass
|
4
|
+
@auto_show = auto_show
|
5
|
+
@id = id
|
6
|
+
@remove_on_hide = @auto_show
|
4
7
|
|
5
8
|
super
|
6
9
|
end
|
7
10
|
|
8
11
|
def before_render
|
12
|
+
return unless @auto_show
|
13
|
+
|
9
14
|
controller.instance_variable_set(:@using_modal, true)
|
10
15
|
end
|
11
16
|
end
|
data/pg_rails/lib/version.rb
CHANGED