dlegr250_material_design 0.2.08 → 0.2.09
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13201ed1ecd6440dbd2b2c8e3fda9d1567e5fd94
|
4
|
+
data.tar.gz: 50b61129e13890dc3ab7c3c9216e78f5acd17f9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e0ff6a0f70d80b437b878b89afb9d369795a9a422b811740e13ee8636587229aef3cd6df8007fcaec8c4a5b381299d34ee94e26cb40401c55aea7d150c94b0f
|
7
|
+
data.tar.gz: 63e5028efdf444fa871a9206e440c6eddb23bcf6f7c7e2f0baae58ed9dc94f24129b6da212ddd67e412f2c6959b8009f2672f22362a45f7ff923f438efd1782c
|
@@ -11,12 +11,19 @@ class App.MD.Snackbar
|
|
11
11
|
$("body").on "click", "#snackbar", =>
|
12
12
|
@hide()
|
13
13
|
|
14
|
+
if $("body").data("snackbar").length > 0
|
15
|
+
App.MD.Snackbar.create($("body").data("snackbar"))
|
16
|
+
|
17
|
+
if $("body").data("snackbar-error").length > 0
|
18
|
+
App.MD.Snackbar.create($("body").data("snackbar-error"), { css_class: "snackbar-error" })
|
19
|
+
|
14
20
|
@create: (text, options = {}) ->
|
15
21
|
@text = text
|
16
22
|
|
17
23
|
# Set options to override defaults
|
18
24
|
@duration = options["duration"] || 5000
|
19
25
|
@delay = options["delay"] || 500
|
26
|
+
@css_class = options["css_class"] || ""
|
20
27
|
|
21
28
|
if @visible
|
22
29
|
# Force hide current one via animation
|
@@ -37,7 +44,7 @@ class App.MD.Snackbar
|
|
37
44
|
|
38
45
|
@show: () ->
|
39
46
|
@element().html(@text)
|
40
|
-
@element().addClass("visible")
|
47
|
+
@element().addClass(@css_class).addClass("visible")
|
41
48
|
$(".fab").addClass("move-with-snackbar")
|
42
49
|
|
43
50
|
@hide: () ->
|