growlyflash 0.8.1 → 0.8.2

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: 550c01e079f423fa3d25636001a7dadca21f5d04
4
- data.tar.gz: 1db321e8f58905109bdac189df67d992dfa7c97e
3
+ metadata.gz: b1baad0d7665e972816a67497b48d981203b5a0b
4
+ data.tar.gz: be7f580fc858b5e03639757f3aa6ad9dc2387ccc
5
5
  SHA512:
6
- metadata.gz: e7e38b36366b1ec3848a1233ae6dd25ab4779d8ef228f8d847b5505240bc8395597bd238e7cccd06e8b719d73f83c745714720c45268126c5a089644ae0adc11
7
- data.tar.gz: 1108b0b772be4b1cf7c157695fc9736c0468e1c18a742886abae05b451c9cc1b0092f4da3d1959cdf6dcd8070fc0ab4e7da42e91be694938a80b2a1c423ecaaa
6
+ metadata.gz: 7b6de4c99e7ea1f48055601d45802180d81a77228195a55fd78a439b2e39c9decd7424be0773d8ba510317ddd8dcf3f185e403701b55472a1e6f5ebe8af53a4e
7
+ data.tar.gz: 621a9460fd7e752ab6ed78591fed417689c451c4fa40cbb950b7316da65b1cea5257a86025ae06c280035881ba6523302605ab0d9858236e95bd0b79c4641d92
@@ -2,4 +2,5 @@
2
2
  #= require ./growlyflash/listener
3
3
 
4
4
  jQuery ->
5
+ Growlyflash.build_shorthands()
5
6
  Growlyflash.listen_on this
@@ -19,6 +19,16 @@ class Growlyflash
19
19
  notice: 'info'
20
20
  success: 'success'
21
21
 
22
+ _build_shorthand = (type) -> (msg) ->
23
+ $.growlyflash(new Growlyflash.FlashStruct(msg, type))
24
+
25
+ @build_shorthands = ->
26
+ for type, name of @KEY_MAPPING
27
+ Growlyflash[type] ?= _build_shorthand(type)
28
+ if name isnt type
29
+ Growlyflash[name] ?= Growlyflash[type]
30
+ return
31
+
22
32
  @DISMISS = """<button type="close" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>"""
23
33
 
24
34
  _titleize = (s) -> s.replace /^./, (m) -> do m.toUpperCase
@@ -61,7 +71,11 @@ class Growlyflash
61
71
  list
62
72
 
63
73
  show: => @el.toggleClass('in', on)
64
- close: => @el.alert?('close')
74
+ close: =>
75
+ @el.fadeOut( =>
76
+ $(@).remove()
77
+ )
78
+
65
79
 
66
80
  calc_top_offset: ({spacing}) ->
67
81
  amount = _top(@el)
@@ -1,3 +1,3 @@
1
1
  module Growlyflash
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
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.1
4
+ version: 0.8.2
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: 2015-06-21 00:00:00.000000000 Z
11
+ date: 2015-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties