growlyflash 0.9.0 → 0.9.1

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
  SHA1:
3
- metadata.gz: b5bdb71797c995b37f15c49c0b018be232865ea1
4
- data.tar.gz: ad0e705a02db6cdad61b9fff4526546143d167e3
3
+ metadata.gz: b13904ea56914736cdd2141a68c98ef33a39f90a
4
+ data.tar.gz: 227479133bbdb273df4547bcacb9a4efbbbd1eb0
5
5
  SHA512:
6
- metadata.gz: 26beff37ce05d030c3aeff1edee38d65eadf237082ddc0050ecab2c17abb21cea7237ca2c440c0aff0808d5bebc8d03dcac51a6b9a54916beb04a65b56ca4a00
7
- data.tar.gz: 34fc9d12bef68a20f266cc7fe9ef1ce1135c155203883bf64bdf49b4b2e06fec0fcc70e943f6ef46f23bc32f314f537f7e34a041ba012d23a79dc05420bef8ae
6
+ metadata.gz: 293951b1d18f476e9dd672b0147edb72839cfa5a30144506abe703bd5ad071dc8f2aa5121eb9e1f6754e2cf5c061ffa688c886f156158e6e48f3fe8290201af8
7
+ data.tar.gz: 0f3d80028d5c4da312d81c5a28fe1bd920b47c1c0bf079b8e0c80aaa1744c90bb91d78918114326786eedf3ca6272ef101fe6c0ca46060add66d00aa587d098f
@@ -1,4 +1,4 @@
1
- class Growlyflash
1
+ class @Growlyflash
2
2
  @debug = off
3
3
 
4
4
  @defaults =
@@ -48,7 +48,7 @@ class Growlyflash
48
48
  html += @flash.msg
49
49
 
50
50
  @el = ($ '<div>', html: html, class: @class_list().join(' '), role: "alert")
51
- @el.appendTo(target)
51
+ @el = @el.appendTo(($ target))
52
52
 
53
53
  before_show?.call(this)
54
54
 
@@ -95,5 +95,4 @@ class Growlyflash
95
95
  Growlyflash[name] ?= Growlyflash[type]
96
96
  return
97
97
 
98
- window.Growlyflash = Growlyflash
99
- jQuery.growlyflash = Growlyflash.growl
98
+ jQuery.growlyflash = Growlyflash.growl
@@ -1,4 +1,4 @@
1
- class Growlyflash.Listener
1
+ class Listener
2
2
  # Alerts stack
3
3
  class Stack
4
4
  constructor: (@items...) ->
@@ -20,7 +20,7 @@ class Growlyflash.Listener
20
20
  do @purge
21
21
 
22
22
  @HEADER = 'X-Message'
23
- @EVENTS = 'ajax:complete ajaxComplete turbolinks:request-end'
23
+ @EVENTS = 'ajax:complete ajaxComplete'
24
24
 
25
25
  process = (alerts = {}) ->
26
26
  new Growlyflash.FlashStruct(msg, type) for type, msg of alerts when msg?
@@ -33,12 +33,15 @@ class Growlyflash.Listener
33
33
  @stack ?= new Stack()
34
34
  @process_static() if window.flashes?
35
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))
36
+ if xhr ?= event.data?.xhr
37
+ source = process_from_header(xhr.getResponseHeader(Growlyflash.Listener.HEADER))
38
+ @stack.push_only_fresh source
39
+ return
38
40
 
39
41
  process_static: ->
40
42
  @stack.push alert for alert in process(window.flashes)
41
43
  delete window.flashes
42
44
 
43
- Growlyflash.listen_on = (context) ->
44
- @listener ?= new @Listener(context)
45
+ @Growlyflash.Listener = Listener
46
+ @Growlyflash.listen_on = (context) ->
47
+ @listener ?= new @Listener(context)
@@ -1,3 +1,3 @@
1
1
  module Growlyflash
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
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.9.0
4
+ version: 0.9.1
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-07-19 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties