growlyflash 0.8.5 → 0.9.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
  SHA1:
3
- metadata.gz: d862dbb8bed801ec3ed62d9dabfa0280b5539f2d
4
- data.tar.gz: 10028e8123cf9a073242e21946c5bab10ef37aa4
3
+ metadata.gz: b5bdb71797c995b37f15c49c0b018be232865ea1
4
+ data.tar.gz: ad0e705a02db6cdad61b9fff4526546143d167e3
5
5
  SHA512:
6
- metadata.gz: c5d05be92a05c84afdb8948c219b551e68b20e2741190dbd960155df78d994ab4c4a60e19812074d740f7e36a70da59e9729e0f5149868ddf9100ee5c1124ce1
7
- data.tar.gz: e70a3b83079b1fa6096051ee55d7821edd5c6d3df3c6af2f237c6562c140cab8b3dbf3f5e0c6e1b6232c9d980e058f639af018b6c58ca78ea92b1be9dd182d95
6
+ metadata.gz: 26beff37ce05d030c3aeff1edee38d65eadf237082ddc0050ecab2c17abb21cea7237ca2c440c0aff0808d5bebc8d03dcac51a6b9a54916beb04a65b56ca4a00
7
+ data.tar.gz: 34fc9d12bef68a20f266cc7fe9ef1ce1135c155203883bf64bdf49b4b2e06fec0fcc70e943f6ef46f23bc32f314f537f7e34a041ba012d23a79dc05420bef8ae
@@ -44,7 +44,7 @@ class Growlyflash
44
44
 
45
45
  html = ""
46
46
  html += h.dismiss() if dismiss
47
- html += h.title(@opts.type) if title? and @opts.type?
47
+ html += h.title(@opts.type) if title and @opts.type?
48
48
  html += @flash.msg
49
49
 
50
50
  @el = ($ '<div>', html: html, class: @class_list().join(' '), role: "alert")
@@ -19,8 +19,8 @@ class Growlyflash.Listener
19
19
  @push(alert, dumped) if dumped not in recent
20
20
  do @purge
21
21
 
22
- HEADER = 'X-Message'
23
- EVENTS = 'ajax:complete ajaxComplete'
22
+ @HEADER = 'X-Message'
23
+ @EVENTS = 'ajax:complete ajaxComplete turbolinks:request-end'
24
24
 
25
25
  process = (alerts = {}) ->
26
26
  new Growlyflash.FlashStruct(msg, type) for type, msg of alerts when msg?
@@ -32,8 +32,9 @@ class Growlyflash.Listener
32
32
  constructor: (context) ->
33
33
  @stack ?= new Stack()
34
34
  @process_static() if window.flashes?
35
- ($ context).on EVENTS, (_, xhr) =>
36
- @stack.push_only_fresh process_from_header(xhr.getResponseHeader(HEADER))
35
+ ($ context).on Growlyflash.Listener.EVENTS, (event, xhr) =>
36
+ xhr ?= event.data?.xhr
37
+ @stack.push_only_fresh process_from_header(xhr.getResponseHeader(Growlyflash.Listener.HEADER))
37
38
 
38
39
  process_static: ->
39
40
  @stack.push alert for alert in process(window.flashes)
@@ -1,3 +1,3 @@
1
1
  module Growlyflash
2
- VERSION = "0.8.5"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: growlyflash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tõnis Simo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.6.2
120
+ rubygems_version: 2.6.6
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Popup ActionDispatch::Flash within Bootstrap alert in Rails app like a growl