ama_layout 11.4.0 → 11.5.0

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: bdce42e1e72479fb3eaf186229427db6769f7b589851cb6e9b4ba3300242a919
4
- data.tar.gz: 39938fcb52b8df2c49a5a6fafa59a5c6776574869a2def36f73c71471cbf890c
3
+ metadata.gz: ce403ae88f2c85275f43e1bd3bb07f7c936573928deb76e34114c4c6a14adaa7
4
+ data.tar.gz: 289905a9d60f38e96d21c4b93486f6b1ce7decef3d1b441ace5244b07c652a45
5
5
  SHA512:
6
- metadata.gz: 0ac9377df0287eec02b6b475083e6930d73d6ac711ddac7304a1a820b25a9654d9a31e66e5312c743c39d11e57fa1dd0dcb53b160272fdcf821ccc27584ea188
7
- data.tar.gz: 005cf0cee9e64b64159b08f0dc6c30e21258ae2a5ecbce31493311e7bc577a95f7de4dff0f955f8dc14a3862666f791e0a23c643abb8a493db59149a70e5eef2
6
+ metadata.gz: d1f3309b20ed355bc384787f6ec68840433eb362e26d9a00f9e3c88a289363fdddfc6e46eed2513264dcd91dcc8d7e57c7eae9f4161db8bf02a5343ae8054303
7
+ data.tar.gz: 252aa2096926f2617d9790595475874f02de2fa2a9e6b1da0823160a5ae43e65bb76ce9523083e1a20e43424ef0dc41fb76c94a097af353803cd0c33c47df722
@@ -54,20 +54,32 @@ class AMALayout.EmailSuggestion
54
54
  domains: @domains
55
55
  secondLevelDomains: @secondLevelDomains
56
56
  suggested: (element, suggestion) =>
57
+ event = @buildEvent()
57
58
  text = @suggestionMarkup suggestion.address, suggestion.domain
58
59
  if !$('.email_hint').length
59
- $("<div class='email_hint'>#{text}</div>").insertAfter(element).fadeIn 150
60
+ $("<div class='email_hint'>#{text}</div>").insertAfter(element).show()
60
61
  else
61
62
  $('.email_hint').html text
63
+ window.dispatchEvent(event)
62
64
  empty: (element) ->
65
+ event = @buildEvent()
63
66
  $('.email_hint').html ''
67
+ window.dispatchEvent(event)
64
68
 
65
69
  $(document).on 'click', '.email_hint .suggestion a.email_domain', (e) =>
66
70
  @trackUsage()
71
+ event = @buildEvent()
67
72
  email_hint = $(e.originalEvent.target).parents('.email_hint')
68
73
  email = $(email_hint).prevAll('input[type=email]:last')
69
74
  $(email).val $('.suggestion').first().text()
70
75
  $('.email_hint').remove()
76
+ window.dispatchEvent(event)
77
+
78
+ buildEvent: () ->
79
+ if typeof(Event) is 'function'
80
+ new Event('mailcheck')
81
+ else
82
+ document.createEvent('Event').initEvent('mailcheck', true, true)
71
83
 
72
84
  suggestionMarkup: (address, domain) ->
73
85
  "Did you mean " +
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AmaLayout
4
- VERSION = '11.4.0'
4
+ VERSION = '11.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ama_layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.4.0
4
+ version: 11.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darko Dosenovic
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-03-05 00:00:00.000000000 Z
16
+ date: 2021-04-16 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: breadcrumbs_on_rails