growlyflash 0.2.3 → 0.2.4

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: 0916448044b4b1ad571a79e8fdf5d0a2e3b9c84e
4
- data.tar.gz: e4742b531cbaceb86fbfa2580c8be42f14ffff5f
3
+ metadata.gz: 56deb9cbbac30d22733c75fc5ca05b30f9aca062
4
+ data.tar.gz: 25297a9aca94d986447afa8bed4d6c0052f70aca
5
5
  SHA512:
6
- metadata.gz: 29ff204c2aec4df289e9806f9fc6589e2a1df0698f62848660d96916e6aa995073304cccfc3594580459ee12609a96d98095a6d1f6577f6acc973f8b55f5ccb5
7
- data.tar.gz: f8bb6a87feefe6c0b243d0f35bea97ac00509c2ce497a587a670c2aebecdcd613768a9ee9f59df29f41acfaaaef085648855f6491f2cb9d38cc93ec0bd9bad51
6
+ metadata.gz: 20e7c850bbd303165ba55e3f07e2d843b87dbe3ef33a1987683969a280c10e286ad689748c8c70a89db0312247595fb1c801ab476a2a627ecfe43c4c4f255cb9
7
+ data.tar.gz: 4beb7817bdb5525b372f11e9d8c30f40f68dd314e20b0675e36de61299c0ede295dc5071da4c587476f0d603a74215e2009b0df6f541b5b9dc534a05ba02ba07
data/README.md CHANGED
@@ -9,60 +9,76 @@ Based on rewritten in coffeescript [Bootstrap Growl](https://github.com/ifightcr
9
9
  ## Installation
10
10
 
11
11
  Add this line to your application's Gemfile:
12
-
13
- gem 'growlyflash'
14
-
12
+ ````ruby
13
+ gem 'growlyflash'
14
+ ````
15
15
  And then execute:
16
-
17
- $ bundle
18
-
16
+ ````
17
+ $ bundle
18
+ ````
19
19
  For non-XHR requests append the following before other javascripts inside `<head>`:
20
-
21
- <%= growlyflash_static_notices %>
22
-
20
+ ````erb
21
+ <%= growlyflash_static_notices %>
22
+ ````
23
23
  And require glowlyflash in `app/assets/javascripts/application.js`
24
-
25
- //= require growlyflash/growlyflash
24
+ ````js
25
+ //= require growlyflash/growlyflash
26
+ ````
26
27
 
27
28
  ## Customize
28
29
 
29
30
  If you want to change default options, you can override them somewhere in your coffee/js:
30
-
31
- $.bootstrapGrowl.defaults = $.extend on, $.bootstrapGrowl.defaults,
32
- # Box width (number or css-like string, etc. "auto")
33
- width: 250
34
-
35
- # Auto-dismiss timeout. Set it to 0 if you want to disable auto-dismiss
36
- delay: 4000
37
-
38
- # Spacing between boxes in stack
39
- spacing: 10
40
-
41
- # Appends boxes to a specific container
42
- target: 'body'
43
-
44
- # Show close button
45
- dismiss: true
46
-
47
- # Default class suffix for alert boxes.
48
- # Use the following mapping (Flash key => Bootstrap Alert)
49
- # warning: null
50
- # error: "error"
51
- # notice: "info"
52
- # success: "success"
53
- type: null
54
-
55
- # Horizontal aligning (left, right or center)
56
- align: 'right'
57
-
58
- # Margin from the closest side
59
- alignAmount: 20
60
-
61
- # Offset from window bounds
62
- offset:
63
- from: 'top'
64
- amount: 20
65
-
31
+ ````coffee
32
+ $.bootstrapGrowl.defaults = $.extend on, $.bootstrapGrowl.defaults,
33
+ # Box width (number or css-like string, etc. "auto")
34
+ width: 250
35
+
36
+ # Auto-dismiss timeout. Set it to 0 if you want to disable auto-dismiss
37
+ delay: 4000
38
+
39
+ # Spacing between boxes in stack
40
+ spacing: 10
41
+
42
+ # Appends boxes to a specific container
43
+ target: 'body'
44
+
45
+ # Show close button
46
+ dismiss: true
47
+
48
+ # Default class suffix for alert boxes.
49
+ # Use the following mapping (Flash key => Bootstrap Alert)
50
+ # warning: null
51
+ # error: "error"
52
+ # notice: "info"
53
+ # success: "success"
54
+ type: null
55
+
56
+ # Horizontal aligning (left, right or center)
57
+ align: 'right'
58
+
59
+ # Margin from the closest side
60
+ alignAmount: 20
61
+
62
+ # Offset from window bounds
63
+ offset:
64
+ from: 'top'
65
+ amount: 20
66
+ ````
67
+
68
+ Insert the following if you want to close alert boxes by clicking on themselves.
69
+ Also it doesn't steel focus from toggled elements like dropdowns and works fine with touch devices,
70
+ so I advise to use it:
71
+ ````coffee
72
+ jQuery ->
73
+ # ...
74
+ $(document).on 'click.alert.data-api', '[data-dismiss="alert"]', (e) ->
75
+ e.stopPropagation()
76
+
77
+ $(document).on 'touchstart click', ".bootstrap-growl", (e) ->
78
+ e.stopPropagation()
79
+ $('[data-dismiss="alert"]', @).click()
80
+ off
81
+ ````
66
82
 
67
83
  ## Contributing
68
84
 
@@ -1,3 +1,3 @@
1
1
  module Growlyflash
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -17,7 +17,7 @@ do ($ = jQuery) ->
17
17
  alignAmount = css_metrics_val alignAmount
18
18
 
19
19
  box_alert = $ """
20
- <div class="#{alert_classes_add type}">
20
+ <div class="#{alert_classes_add(type).join(" ")}">
21
21
  #{'<a class="close" data-dismiss="alert" href="#">&times;</a>' if dismiss}
22
22
  #{message}
23
23
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: growlyflash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tõnis Simo