pg_rails 7.1.14 → 7.1.15

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: a86bbc28d3c58f60700af25390dc43d051e14c2c9b493005554ddd3407380351
4
- data.tar.gz: 061c9da5f9ddf70bf5b878f5a7ecc21d4916bcd6bba702d652213a80e8f085f2
3
+ metadata.gz: 266cfada8ad43cc522e6208107c12715f29ac0393c93154046d377f0ca434598
4
+ data.tar.gz: 1fec4b327371b492aa75ec6640b7c9a85f93afceb7d89074aec369f67f85cb11
5
5
  SHA512:
6
- metadata.gz: 9da11c05db885cdf43976ff3114e4c1971a1dc27909d529b4447bcd31bf750957b84701663ae1003c7e6d993493922270a61f4512e13d67eef83f92f73ddead3
7
- data.tar.gz: 4e66d31c2819f903c9a8dc30654e3b4522662c310fe931f98f49d3bd9ee1815017515f28dede35bc018433a531fe25ed70081333a89cdf26795852ca6c602653
6
+ metadata.gz: a985cde74ba0a65f4f234d0b5648cf7465291dfcd16da6d92ea9d3a1b62c1bb8a9a0c70a4936dcf7bbf679b2f8b6d8ba56b3a9e8bdf8133e3d81b8e5d28a9941
7
+ data.tar.gz: 9213cd8758d1f4ea9a9ead1c5f0aa8ba26e67cb83ec2a643e7635a0e6ce37caa02e722f174b5b5b10ecfac6f65eb386d0356e8f54bb12c9e34bc91552fb8bed9
@@ -32,7 +32,7 @@ export default class extends Controller {
32
32
 
33
33
  disconnect (e) {
34
34
  this.modalPuntero.hide()
35
- this.element.dispatchEvent(new Event('hidden.bs.modal'))
35
+ document.dispatchEvent(new Event('hidden.bs.modal'))
36
36
  this.modalPuntero.dispose()
37
37
  }
38
38
  }
@@ -91,11 +91,12 @@ module PgEngine
91
91
  end
92
92
 
93
93
  if Current.user.present?
94
+ # TODO: quitar el limit 3, discard en events
94
95
  @notifications = Current.user.notifications.order(id: :desc).includes(:event)
95
96
  .where(type: 'SimpleUserNotifier::Notification')
97
+ .limit(3)
96
98
  unseen = @notifications.unseen.any?
97
- # FIXME: testear y fixear, buscar el primero que esté present
98
- tooltip = @notifications.unseen.map(&:tooltip).first
99
+ tooltip = @notifications.unseen.map(&:tooltip).select(&:presence).first
99
100
  @notifications_bell = NotificationsBellComponent.new(
100
101
  unseen:,
101
102
  tooltip:
@@ -5,10 +5,24 @@ export default class extends Controller {
5
5
  tooltip = null
6
6
 
7
7
  connect () {
8
- this.tooltip = new bootstrap.Tooltip(this.element)
8
+ if (this.element.dataset.bsTrigger === 'contextmenu') {
9
+ this.element.addEventListener('contextmenu', (ev) => {
10
+ ev.preventDefault()
11
+ if (!this.tooltip) {
12
+ this.tooltip = new bootstrap.Tooltip(this.element, {
13
+ trigger: 'focus'
14
+ })
15
+ this.tooltip.show()
16
+ }
17
+ })
18
+ } else {
19
+ this.tooltip = new bootstrap.Tooltip(this.element)
20
+ }
9
21
  }
10
22
 
11
23
  disconnect () {
12
- this.tooltip.dispose()
24
+ if (this.tooltip) {
25
+ this.tooltip.dispose()
26
+ }
13
27
  }
14
28
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.1.14'
4
+ VERSION = '7.1.15'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.14
4
+ version: 7.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso